home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / configure.in < prev    next >
Encoding:
Text File  |  1995-08-31  |  95.1 KB  |  3,334 lines

  1. dnl Synched up with: FSF 19.28.  Partially synched with 19.29.
  2. dnl
  3. dnl This is an autoconf script.
  4. dnl To rebuild the `configure' script from this, execute the command
  5. dnl     autoconf
  6. dnl in the directory containing this script.  You must have autoconf
  7. dnl version 1.9 or later.
  8. dnl
  9. dnl The following text appears in the resulting `configure' script,
  10. dnl explaining how to rebuild it.
  11. dnl
  12. dnl Subroutine to find version of X being used
  13. dnl It can't use xmkmf because the first version in the user's path
  14. dnl may not belong to the version of X that is being built with
  15. define(AC_FIND_X_VERSION,
  16. [AC_CHECKING(the version of X11 being used)
  17. cat > conftest.${ac_ext} <<EOF
  18. #include <X11/Intrinsic.h>
  19. int main() {
  20. #if (XlibSpecificationRelease == 4)
  21.   printf ("X11R4\n");
  22. #elif (XlibSpecificationRelease == 5)
  23.   printf ("X11R5\n");
  24. #elif (XlibSpecificationRelease == 6)
  25.   printf ("X11R6\n");
  26. #endif
  27.   return 0;
  28. }
  29. EOF
  30. dnl We need to run this which will prevent cross-configuring.  But since
  31. dnl we can't do that anyhow, oh darn.
  32. ac_save_LIBS="${LIBS}"
  33. LIBS="${LIBS} ${DEFS}"
  34. if eval $ac_compile; then
  35.   ac_find_x_version=`./conftest`
  36.   [
  37.     if [ "$ac_find_x_version" = "X11R4" ]; then
  38.       ] AC_DEFINE(THIS_IS_X11R4) [
  39.     elif [ "$ac_find_x_version" = "X11R5" ]; then
  40.       ] AC_DEFINE(THIS_IS_X11R5) [
  41.     elif [ "$ac_find_x_version" = "X11R6" ]; then
  42.       ] AC_DEFINE(THIS_IS_X11R6) [
  43.     fi
  44.   ]
  45. fi
  46. LIBS=$ac_save_LIBS
  47. rm -f conftest*]
  48. )dnl
  49. AC_PREREQ(1.9)dnl means 'delete newline' and this one needs to be here
  50. [#!/bin/sh
  51. #### Configuration script for XEmacs.
  52. #### Copyright (C) 1994 Free Software Foundation, Inc.
  53.  
  54. ### Don't edit this script!
  55. ### This script was automatically generated by the `autoconf' program
  56. ### from the file `./configure.in'.
  57. ### To rebuild it, execute the command
  58. ###    autoconf
  59. ### in the this directory.  You must have autoconf version 1.9 or later.
  60.  
  61. ### This file is part of XEmacs.
  62.  
  63. ### XEmacs is free software; you can redistribute it and/or modify it
  64. ### under the terms of the GNU General Public License as published by
  65. ### the Free Software Foundation; either version 2, or (at your
  66. ### option) any later version.
  67.  
  68. ### XEmacs is distributed in the hope that it will be useful, but
  69. ### WITHOUT ANY WARRANTY; without even the implied warranty of
  70. ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  71. ### General Public License for more details.
  72.  
  73. ### You should have received a copy of the GNU General Public License
  74. ### along with XEmacs; see the file COPYING.  If not, write to the
  75. ### Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  76.  
  77. ### Since XEmacs has configuration requirements that autoconf can't
  78. ### meet, this file is an unholy marriage of custom-baked
  79. ### configuration code and autoconf macros.
  80. ###
  81. ### We use the m4 quoting characters [ ] (as established by the
  82. ### autoconf system) to include large sections of raw sewage - Oops, I
  83. ### mean, shell code - in the final configuration script.
  84. ###
  85. ### Usage: configure config_name
  86. ###
  87. ### If configure succeeds, it leaves its status in config.status.
  88. ### If configure fails after disturbing the status quo,
  89. ###     config.status is removed.
  90.  
  91. ### Remove any more than one leading "." element from the path name.
  92. ### If we don't remove them, then another "./" will be prepended to
  93. ### the file name each time we use config.status, and the program name
  94. ### will get larger and larger.  This wouldn't be a problem, except
  95. ### that since progname gets recorded in all the Makefiles this script
  96. ### produces, move-if-change thinks they're different when they're
  97. ### not.
  98. ###
  99. ### It would be nice if we could put the ./ in a \( \) group and then
  100. ### apply the * operator to that, so we remove as many leading ./././'s
  101. ### as are present, but some seds (like Ultrix's sed) don't allow you to
  102. ### apply * to a \( \) group.  Bleah.
  103. progname="`echo $0 | sed 's:^\./\./:\./:'`"
  104.  
  105.  
  106. ### Establish some default values.
  107. run_in_place='no'
  108. prefix='/usr/local'
  109. exec_prefix='${prefix}'
  110. bindir='${exec_prefix}/bin'
  111. datadir='${prefix}/lib'
  112. statedir='${prefix}/lib'
  113. libdir='${exec_prefix}/lib'
  114. mandir='${prefix}/man/man1'
  115. infodir='${prefix}/lib/xemacs-${version}/info'
  116. lispdir='${datadir}/xemacs-${version}/lisp'
  117. sitelispdir='${datadir}/xemacs/site-lisp'
  118. etcdir='${datadir}/xemacs-${version}/etc'
  119. lockdir='${statedir}/xemacs/lock'
  120. archlibdir='${libdir}/xemacs-${version}/${configuration}'
  121. with_menubars=''
  122. with_scrollbars=''
  123. with_dialogs=''
  124. const_is_losing='yes'
  125. dont_have_xmu=''
  126. puresize=''
  127. cflags='NO_CFLAGS_DEFINED'
  128. dynamic=''
  129. with_x11=''
  130. rel_alloc='default'
  131. internal_makefile_list='Makefile lib-src/Makefile.in man/Makefile src/Makefile.in lwlib/Makefile.in dynodump/Makefile.in'
  132. energize_version='no'
  133. native_sound_lib=''
  134. # make normal error-checking be the default in alpha and beta versions, so
  135. # that bugs get noticed.  Change this for released versions.
  136. error_check_default='none'
  137. error_check_extents=$error_check_default
  138. error_check_typecheck=$error_check_default
  139. error_check_bufpos=$error_check_default
  140. error_check_gc=$error_check_default
  141. error_check_malloc=$error_check_default
  142. # debug=yes must be set when error checking is present.  This should be
  143. # fixed up.
  144. debug=$error_check_default
  145. quantify='no'
  146. # use-assertions should be 'yes' by default.  Too many people in this
  147. # world have core dumps turned off by default or "can't find where the
  148. # core file went".  At least we should get some useful output ...
  149. use_assertions='yes'
  150.  
  151. # # gnu echo silently eats `--help', `--version', `-n', `-e', `-E', `-n'.
  152. # # other versions of echo eat any strings beginning with `-n'.
  153. # # when parsing arguments, special case these strings and don't
  154. # # pass them through echo
  155. # echo=/bin/echo
  156. #
  157. # this approach abandoned in favor of
  158. #
  159. #   echo "" ${stuff_to_filter} | sed -e 's:^ ::'
  160.  
  161. # On Sun systems, people sometimes set up the variable CPP
  162. # with a value that is a directory, not an executable at all.
  163. # Detect that case, and ignore that value.
  164. if [ "x$CPP" != x ] && [ -d "$CPP" ] ; then
  165.   CPP=
  166. fi
  167.  
  168. #### Usage messages.
  169.  
  170. short_usage="Usage: ${progname} CONFIGURATION [-OPTION[=VALUE] ...]
  171.  
  172. Set compilation and installation parameters for XEmacs, and report.
  173. CONFIGURATION specifies the machine and operating system to build for.
  174.  
  175. Note that for most of the following options, you can explicitly disable
  176. them using \`--OPTION=no'.  This is especially useful for auto-detected
  177. options.
  178.   
  179. General options:
  180.  
  181. --help            Issue this usage message.
  182. --verbose        Display the results of configure tests.
  183.  
  184. Compiler options:
  185.  
  186. --compiler        Specify compiler.
  187. --with-gcc        Use GCC to compile XEmacs (auto-detected).
  188. --with-lcc        Use LCC to compile XEmacs.
  189. --with-gcc=no        Don't use GCC to compile XEmacs.
  190. --cflags=FLAGS        Override the default values for CFLAGS.
  191. --site-includes=DIR    Other header file directories.
  192. --site-libraries=DIR    Other library directories.
  193. --site-runtime-libraries=DIR
  194.             Paths to add with -R flag.
  195. --dynamic        Link dynamically if supported by system.
  196. --srcdir=DIR        Look for the XEmacs source files in DIR.
  197. --const-is-losing=no    Allow the use of const in the source code.
  198.  
  199. Installation options:
  200.   
  201. --prefix=DIR        Install files below DIR.  Defaults to \`${prefix}'.
  202. --run-in-place          Use the source tree for installation.
  203.  
  204. Window-system options:
  205.  
  206. --with-x        Support the X Window System (auto-detected).
  207. --with-x=no        Don't support X.
  208. --x-includes=DIR     Search for X header files in DIR.
  209. --x-libraries=DIR    Search for X libraries in DIR.
  210. --with-ns        Support NeXTstep windows (not yet implemented).
  211. --with-menubars=TYPE    Use TYPE menubars (lucid or motif).
  212.             *WARNING*  The Motif menubar is currently broken.
  213. --with-scrollbars=TYPE    Use TYPE scrollbars (lucid, motif, or athena).
  214. --with-dialogs=TYPE    Use TYPE dialog boxes (motif or athena).
  215.             (Lucid menubars and scrollbars are the default.
  216.              Motif dialog boxes will be used if Motif can be
  217.              found.)
  218. --with-xpm        Compile with support for XPM files (auto-detected).
  219. --dont-have-xmu        For those unfortunates whose vendors don't ship Xmu.
  220.  
  221. Additional features:
  222.   
  223. --with-tooltalk        Support the ToolTalk system.
  224. --with-sparcworks    Support the Sun Sparcworks system.
  225. --with-energize        Support the Lucid Energize system.
  226. --with-socks        Compile with support for SOCKS.
  227. --with-xface        Compile with support for X-Face mail header
  228.               conversion (auto-detected).
  229. --with-gif        Compile with support for GIF image conversion
  230.             (not yet implemented).
  231. --with-jpeg        Compile with support for JPEG image conversion
  232.             (not yet implemented).
  233. --with-png        Compile with support for PNG image conversion
  234.             (not yet implemented).
  235. --external-widget    Compile with external widget support.
  236. --with-sound=native    Compile with native sound support (auto-detected).
  237. --with-sound=nas    Compile with network sound support.
  238. --with-sound=both    Compile with native and network sound support.
  239. --native-sound-lib=LIB    Native sound support library.
  240. --with-epoch        Compile with additional Epoch compatibility.
  241. --with-i18n3        Compile with I18N level 3 (not fully supported).
  242. --with-mule        Compile with Mule support.  This doesn't work yet.
  243.  
  244. Debugging options:
  245.  
  246. --debug            Compile with support for debugging XEmacs.
  247.             (Causes code-size increase but no loss of speed.)
  248. --error-checking=TYPE[,TYPE]...
  249.             Compile with internal error-checking added.
  250.             Valid types are extents, bufpos, malloc, gc, typecheck.
  251. --error-checking=none    Disable all internal error-checking.
  252. --error-checking=all    Enable all internal error-checking.
  253.  
  254. Other options:
  255.  
  256. --puresize=VALUE    Override default amount of space for pure Lisp code.
  257. --rel-alloc        Use the relocating allocator (default for this option
  258.               is system-dependent).
  259.  
  260. You may also specify any of the \`path' variables found in
  261. Makefile.in, including --bindir, --libdir, --lispdir, --datadir, and
  262. so on.  Note that we recommend against explicitly setting any of these
  263. variables.  See the INSTALL file for a complete list plus the reasons
  264. we advise not changing them.  Specifying a \'path' variable will override
  265. the --run-in-place value.
  266.  
  267. If successful, ${progname} leaves its status in config.status.  If
  268. unsuccessful after disturbing the status quo, it removes config.status."
  269.  
  270.  
  271. #### Option processing.
  272.  
  273. ### Record all the arguments, so we can save them in config.status.
  274. arguments="$@"
  275.  
  276. ### Shell Magic: Quote the quoted arguments in ARGUMENTS.  At a later date,
  277. ### in order to get the arguments back in $@, we have to do an
  278. ###  `eval set x "$quoted_arguments"; shift'.
  279. quoted_arguments=
  280. for i in "$@"; do
  281.    quoted_arguments="$quoted_arguments '$i'"
  282. done
  283.  
  284. ### Don't use shift -- that destroys the argument list, which autoconf needs
  285. ### to produce config.status.  It turns out that "set - ${arguments}" doesn't
  286. ### work portably.
  287. ### However, it also turns out that many shells cannot expand ${10} at all.
  288. ### So using an index variable doesn't work either.  It is possible to use
  289. ### some shell magic to make 'set x "$arguments"; shift' work portably.
  290. while [ $# != 0 ]; do
  291.   arg="$1"; shift
  292.   case "${arg}" in
  293.  
  294.     ## Anything starting with a hyphen we assume is an option.
  295.     -* )
  296.       ## Separate the switch name from the value it's being given.
  297.       case "${arg}" in
  298.         -*=*)
  299.       opt=`echo '' ${arg} | sed -e 's:^ ::' -e 's:^-*\([^=]*\)=.*$:\1:'`
  300.       val=`echo '' ${arg} | sed -e 's:^ ::' -e 's:^-*[^=]*=\(.*\)$:\1:'`
  301.       valomitted=no
  302.     ;;
  303. #         ## special case these strings since echo may
  304. #         ## silently eat them.
  305. #         --help ) opt=help val=yes valomitted=yes ;;
  306. #         --version ) opt=version val=yes valomitted=yes ;;
  307. #         -e ) opt=e val=yes valomitted=yes ;;
  308. #         -E ) opt=E val=yes valomitted=yes ;;
  309. #         -n ) opt=n val=yes valomitted=yes ;;
  310.         -*)
  311.           ## If FOO is a boolean argument, --FOO is equivalent to
  312.           ## --FOO=yes.  Otherwise, the value comes from the next
  313.           ## argument - see below.
  314.       opt=`echo '' ${arg} | sed -e 's:^ ::' -e 's:^-*\(.*\)$:\1:'`
  315.           val="yes"
  316.           valomitted=yes
  317.         ;;
  318.       esac
  319.  
  320.       ## Change `-' in the option name to `_'.
  321.       optname="${opt}"
  322.       opt="`echo '' ${opt} | sed -e 's:^ ::' | tr - _`"
  323.  
  324.       ## Process the option.
  325.       case "${opt}" in
  326.  
  327.         ## Has the user specified which window systems they want to support?
  328.         "with_x" | "with_x11" )
  329.       ## Make sure the value given was either "yes" or "no".
  330.       case "${val}" in
  331.         y | ye | yes )    val=yes ;;
  332.         n | no )        val=no  ;;
  333.         * )
  334.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  335. Set it to either \`yes' or \`no'."
  336.            echo "${short_usage}") >&2
  337.           exit 1
  338.         ;;
  339.       esac
  340.       eval "with_x11=\"${val}\""
  341.         ;;
  342.  
  343.     ## Has the user specified whether or not they want GCC or LCC?
  344.     "with_gcc" | "with_lcc" )
  345.       ## Make sure the value given was either "yes" or "no".
  346.       case "${val}" in
  347.         y | ye | yes )    val=yes ;;
  348.         n | no )        val=no  ;;
  349.         * )
  350.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  351. Set it to either \`yes' or \`no'."
  352.            echo "${short_usage}") >&2
  353.           exit 1
  354.         ;;
  355.       esac
  356.           eval "${opt}=\"${val}\""
  357.       if [ "${with_gcc}" = "yes" ] && [ "${with_lcc}" = "yes" ] ; then
  358.         (echo "${progname}: only one of --with-gcc and --with-lcc may be specified."
  359.          echo "${short_usage}") >&2
  360.         exit 1
  361.       fi
  362.         ;;
  363.  
  364.         ## Has the user specified a compiler to use?
  365.     "compiler" )
  366.       ## If the value was omitted, get it from the next argument.
  367.       if [ "${valomitted}" = "yes" ]; then
  368.         ## Get the next argument from the argument list, if there is one.
  369.             if [ $# = 0 ]; then
  370.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  371.     \`--${optname}=FOO'."
  372.            echo "${short_usage}") >&2
  373.           exit 1
  374.         fi
  375.         val="$1"; shift
  376.       fi
  377.           compiler="${val}"
  378.     ;;
  379.  
  380.         ## Has the user specified a source directory?
  381.     "srcdir" )
  382.       ## If the value was omitted, get it from the next argument.
  383.       if [ "${valomitted}" = "yes" ]; then
  384.         ## Get the next argument from the argument list, if there is one.
  385.             if [ $# = 0 ]; then
  386.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  387.     \`--${optname}=FOO'."
  388.            echo "${short_usage}") >&2
  389.           exit 1
  390.         fi
  391.         val="$1"; shift
  392.       fi
  393.           srcdir="${val}"
  394.     ;;
  395.  
  396.         ## Has the user requested sound support?
  397.     "with_sound" )
  398.       ## value can be native, nas or both. yes is allowed 
  399.       ## as a backwards compatible synonym for native
  400.       case "${val}" in
  401.         y | ye | yes )            val=native ;;
  402.         n | no | non | none )        val=no;;
  403.         na | nat | nati | nativ | native )    val=native  ;;
  404.         ne | net | neta | netau | netaud | netaudi | netaudio | nas )    val=nas  ;;
  405.         b | bo | bot | both )        val=both;;
  406.         * )
  407.           (echo "${progname}: the \`--${optname}' option should have one of the values \`native', \`nas', \`both', or \`none'."
  408.            echo "${short_usage}") >&2
  409.           exit 1
  410.         ;;
  411.       esac
  412.           eval "${opt}=\"${val}\""
  413.         ;;
  414.  
  415.         ## Has the user specified a native sound library?
  416.     ## (the reason for this flag is that, under Suns, both NAS sound
  417.     ## and native sound call their library libaudio.a)
  418.     "native_sound_lib" )
  419.       ## If the value was omitted, get it from the next argument.
  420.       if [ "${valomitted}" = "yes" ]; then
  421.         ## Get the next argument from the argument list, if there is one.
  422.             if [ $# = 0 ]; then
  423.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  424.     \`--${optname}=FOO'."
  425.            echo "${short_usage}") >&2
  426.           exit 1
  427.         fi
  428.         val="$1"; shift
  429.       fi
  430.           native_sound_lib="${val}"
  431.     ;;
  432.  
  433.         ## Has the user requested extra Epoch compatibility?
  434.     "with_epoch" )
  435.       ## Make sure the value given was either "yes" or "no".
  436.       case "${val}" in
  437.         y | ye | yes )    val=yes ;;
  438.         n | no )        val=no  ;;
  439.         * )
  440.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  441. Set it to either \`yes' or \`no'."
  442.            echo "${short_usage}") >&2
  443.           exit 1
  444.         ;;
  445.       esac
  446.           eval "${opt}=\"${val}\""
  447.         ;;
  448.  
  449.         ## Has the user specified a change to the default linking?
  450.     "dynamic" )
  451.       ## Make sure the value given was either "yes" or "no".
  452.       case "${val}" in
  453.         y | ye | yes )    val=yes ;;
  454.         n | no )        val=no  ;;
  455.         * )
  456.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  457. Set it to either \`yes' or \`no'."
  458.            echo "${short_usage}") >&2
  459.           exit 1
  460.         ;;
  461.       esac
  462.           eval "${opt}=\"${val}\""
  463.         ;;
  464.  
  465.         ## Has the user specified Quantify support?
  466.     "quantify" )
  467.       ## Make sure the value given was either "yes" or "no".
  468.       case "${val}" in
  469.         y | ye | yes )    val=yes ;;
  470.         n | no )        val=no  ;;
  471.         * )
  472.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  473. Set it to either \`yes' or \`no'."
  474.            echo "${short_usage}") >&2
  475.           exit 1
  476.         ;;
  477.       esac
  478.           eval "${opt}=\"${val}\""
  479.         ;;
  480.  
  481.         ## Has the user requested SOCKS support?
  482.     "with_socks" )
  483.       ## Make sure the value given was either "yes" or "no".
  484.       case "${val}" in
  485.         y | ye | yes )    val=yes ;;
  486.         n | no )        val=no  ;;
  487.         * )
  488.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  489. Set it to either \`yes' or \`no'."
  490.            echo "${short_usage}") >&2
  491.           exit 1
  492.         ;;
  493.       esac
  494.           eval "${opt}=\"${val}\""
  495.         ;;
  496.  
  497.         ## Has the user requested XPM support?
  498.     "with_xpm" )
  499.       ## Make sure the value given was either "yes" or "no".
  500.       case "${val}" in
  501.         y | ye | yes )    val=yes ;;
  502.         n | no )        val=no  ;;
  503.         * )
  504.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  505. Set it to either \`yes' or \`no'."
  506.            echo "${short_usage}") >&2
  507.           exit 1
  508.         ;;
  509.       esac
  510.           eval "${opt}=\"${val}\""
  511.         ;;
  512.  
  513.         ## Has the user requested XFACE support?
  514.     "with_xface" )
  515.       ## Make sure the value given was either "yes" or "no".
  516.       case "${val}" in
  517.         y | ye | yes )    val=yes ;;
  518.         n | no )        val=no  ;;
  519.         * )
  520.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  521. Set it to either \`yes' or \`no'."
  522.            echo "${short_usage}") >&2
  523.           exit 1
  524.         ;;
  525.       esac
  526.           eval "${opt}=\"${val}\""
  527.         ;;
  528.  
  529.         ## Has the user requested GIF support?
  530.     "with_gif" )
  531.       ## Make sure the value given was either "yes" or "no".
  532.       case "${val}" in
  533.         y | ye | yes )    val=yes ;;
  534.         n | no )        val=no  ;;
  535.         * )
  536.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  537. Set it to either \`yes' or \`no'."
  538.            echo "${short_usage}") >&2
  539.           exit 1
  540.         ;;
  541.       esac
  542.           eval "${opt}=\"${val}\""
  543.         ;;
  544.  
  545.         ## Has the user requested JPEG support?
  546.     "with_jpeg" )
  547.       ## Make sure the value given was either "yes" or "no".
  548.       case "${val}" in
  549.         y | ye | yes )    val=yes ;;
  550.         n | no )        val=no  ;;
  551.         * )
  552.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  553. Set it to either \`yes' or \`no'."
  554.            echo "${short_usage}") >&2
  555.           exit 1
  556.         ;;
  557.       esac
  558.           eval "${opt}=\"${val}\""
  559.         ;;
  560.  
  561.         ## Has the user requested PNG support?
  562.     "with_png" )
  563.       ## Make sure the value given was either "yes" or "no".
  564.       case "${val}" in
  565.         y | ye | yes )    val=yes ;;
  566.         n | no )        val=no  ;;
  567.         * )
  568.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  569. Set it to either \`yes' or \`no'."
  570.            echo "${short_usage}") >&2
  571.           exit 1
  572.         ;;
  573.       esac
  574.           eval "${opt}=\"${val}\""
  575.         ;;
  576.  
  577.         ## Has the user requested NeXTstep support?
  578.     "with_ns" )
  579.       ## Make sure the value given was either "yes" or "no".
  580.       case "${val}" in
  581.         y | ye | yes )    val=yes ;;
  582.         n | no )        val=no  ;;
  583.         * )
  584.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  585. Set it to either \`yes' or \`no'."
  586.            echo "${short_usage}") >&2
  587.           exit 1
  588.         ;;
  589.       esac
  590.           eval "${opt}=\"${val}\""
  591.         ;;
  592.  
  593.         ## Has the user requested that assertions be used?
  594.     "use_assertions" )
  595.       ## Make sure the value given was either "yes" or "no".
  596.       case "${val}" in
  597.         y | ye | yes )    val=yes ;;
  598.         n | no )        val=no  ;;
  599.         * )
  600.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  601. Set it to either \`yes' or \`no'."
  602.            echo "${short_usage}") >&2
  603.           exit 1
  604.         ;;
  605.       esac
  606.           eval "${opt}=\"${val}\""
  607.         ;;
  608.  
  609.         ## Has the user requested error-checking?
  610.     "error_checking" )
  611.       ## value can be all, none, and/or a list of categories to check.
  612.       ## Example: --error-checking=all,noextents,nobufpos
  613.       ## Example: --error-checking=none,malloc,gc
  614.       
  615.       for x in `echo "${val}" | sed 's/,/ /'` ; do
  616.         case "${x}" in
  617.           # all and none are only permitted as the first in the list.
  618.           n | no | non | none ) new_default=no ;;
  619.           a | al | all )        new_default=yes ;;
  620.  
  621.           extents )       error_check_extents=yes ;;
  622.           noextents )     error_check_extents=no ;;
  623.  
  624.           typecheck )     error_check_typecheck=yes ;;
  625.           notypecheck )   error_check_typecheck=no ;;
  626.  
  627.           bufpos )          error_check_bufpos=yes ;;
  628.           nobufpos )      error_check_bufpos=no ;;
  629.  
  630.           gc )          error_check_gc=yes ;;
  631.           nogc )          error_check_gc=no ;;
  632.  
  633.           malloc )          error_check_malloc=yes ;;
  634.           nomalloc )      error_check_malloc=no ;;
  635.           
  636.           * ) bogus_error_check=yes ;;
  637.         esac
  638.         if [ "$bogus_error_check" -o \
  639.              \( -n "$new_default" -a -n "$echeck_notfirst" \) ]; then
  640.         ( echo "${progname}: Valid types for the \`--${optname}' option are:"
  641.         if [ $error_check_default = yes ]; then
  642.           echo "\`all' (default), \`none', \`noextents', \`notypecheck', \`nobufpos', \`nogc', and \`nomalloc'."
  643.         else
  644.           echo "\`all', \`none' (default), \`extents', \`typecheck', \`bufpos', \`gc', and \`malloc'."
  645.         fi
  646.         echo "${short_usage}" ) >&2
  647.         exit 1
  648.         elif [ "$new_default" ]; then
  649.         error_check_extents=$new_default
  650.         error_check_typecheck=$new_default
  651.         error_check_bufpos=$new_default
  652.         error_check_gc=$new_default
  653.         error_check_malloc=$new_default
  654.         new_default=    # reset this
  655.         fi
  656.         echeck_notfirst=true
  657.       done
  658.     ;;
  659.  
  660.         ## Has the user requested external widget support?
  661.     "external_widget" )
  662.       ## Make sure the value given was either "yes" or "no".
  663.       case "${val}" in
  664.         y | ye | yes )    val=yes ;;
  665.         n | no )        val=no  ;;
  666.         * )
  667.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  668. Set it to either \`yes' or \`no'."
  669.            echo "${short_usage}") >&2
  670.           exit 1
  671.         ;;
  672.       esac
  673.           eval "${opt}=\"${val}\""
  674.         ;;
  675.  
  676.         ## Has the user requested that const be used?
  677.     "const_is_losing" )
  678.       ## Make sure the value given was either "yes" or "no".
  679.       case "${val}" in
  680.         y | ye | yes )    val=yes ;;
  681.         n | no )        val=no  ;;
  682.         * )
  683.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  684. Set it to either \`yes' or \`no'."
  685.            echo "${short_usage}") >&2
  686.           exit 1
  687.         ;;
  688.       esac
  689.           eval "${opt}=\"${val}\""
  690.         ;;
  691.  
  692.         ## Has the user mentioned that they don't have Xmu?
  693.     "dont_have_xmu" )
  694.       ## Make sure the value given was either "yes" or "no".
  695.       case "${val}" in
  696.         y | ye | yes )    val=yes ;;
  697.         n | no )        val=no  ;;
  698.         * )
  699.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  700. Set it to either \`yes' or \`no'."
  701.            echo "${short_usage}") >&2
  702.           exit 1
  703.         ;;
  704.       esac
  705.           eval "${opt}=\"${val}\""
  706.         ;;
  707.  
  708.         ## Has the user specified a value for PURESIZE?
  709.     "puresize" )
  710.       ## If the value was omitted, get it from the next argument.
  711.       if [ "${valomitted}" = "yes" ]; then
  712.         ## Get the next argument from the argument list, if there is one.
  713.             if [ $# = 0 ]; then
  714.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  715.     \`--${optname}=FOO'."
  716.            echo "${short_usage}") >&2
  717.           exit 1
  718.         fi
  719.         val="$1"; shift
  720.       fi
  721.           puresize="${val}"
  722.     ;;
  723.  
  724.         ## Has the user specified explicit instructions for rel_alloc?
  725.     "rel_alloc" )
  726.       ## Make sure the value given was either "yes", "no", or "default".
  727.       case "${val}" in
  728.         y | ye | yes )    val=yes ;;
  729.         n | no )        val=no  ;;
  730.         d | de | def | defa | defau | defaul | default )
  731.                 val=default ;;
  732.         * )
  733.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value or \`default'.
  734. Set it to either \`yes', \`no', or \`default'."
  735.            echo "${short_usage}") >&2
  736.           exit 1
  737.         ;;
  738.       esac
  739.           eval "${opt}=\"${val}\""
  740.         ;;
  741.  
  742.     ## Has the user tried to tell us where the X files are?
  743.     ## I think these are dopey, but no less than three alpha
  744.     ## testers, at large sites, have said they have their X files
  745.     ## installed in odd places.
  746.     "x_includes" )
  747.       ## If the value was omitted, get it from the next argument.
  748.       if [ "${valomitted}" = "yes" ]; then
  749.         ## Get the next argument from the argument list, if there is one.
  750.             if [ $# = 0 ]; then
  751.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  752.     \`--${optname}=/usr/local/X11/include'."
  753.            echo "${short_usage}") >&2
  754.           exit 1
  755.         fi
  756.             val="$1"; shift
  757.       fi
  758.       x_includes="${val}"
  759.         ;;
  760.     "x_libraries" )
  761.       ## If the value was omitted, get it from the next argument.
  762.       if [ "${valomitted}" = "yes" ]; then
  763.         ## Get the next argument from the argument list, if there is one.
  764.             if [ $# = 0 ]; then
  765.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  766.     \`--${optname}=/usr/local/X11/lib'."
  767.            echo "${short_usage}") >&2
  768.           exit 1
  769.         fi
  770.             val="$1"; shift
  771.       fi
  772.       x_libraries="${val}"
  773.         ;;
  774.  
  775.     "site_includes" )
  776.       ## If the value was omitted, get it from the next argument.
  777.       if [ "${valomitted}" = "yes" ]; then
  778.         ## Get the next argument from the argument list, if there is one.
  779.             if [ $# = 0 ]; then
  780.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  781.     \`--${optname}=/usr/local/X11/include'."
  782.            echo "${short_usage}") >&2
  783.           exit 1
  784.         fi
  785.             val="$1"; shift
  786.       fi
  787.       site_includes="${val}"
  788.       ;;
  789.     
  790.     "site_libraries" )
  791.       ## If the value was omitted, get it from the next argument.
  792.       if [ "${valomitted}" = "yes" ]; then
  793.         ## Get the next argument from the argument list, if there is one.
  794.             if [ $# = 0 ]; then
  795.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  796.     \`--${optname}=/usr/local/X11/lib'."
  797.            echo "${short_usage}") >&2
  798.           exit 1
  799.         fi
  800.             val="$1"; shift
  801.       fi
  802.       site_libraries="${val}"
  803.         ;;
  804.  
  805.     "site_runtime_libraries" )
  806.       ## If the value was omitted, get it from the next argument.
  807.       if [ "${valomitted}" = "yes" ]; then
  808.         ## Get the next argument from the argument list, if there is one.
  809.             if [ $# = 0 ]; then
  810.           (echo "${progname}: You must give a value for the \`--${optname}' option, as in
  811.     \`--${optname}=/usr/local/X11/lib'."
  812.            echo "${short_usage}") >&2
  813.           exit 1
  814.         fi
  815.             val="$1"; shift
  816.       fi
  817.       site_runtime_libraries="${val}"
  818.         ;;
  819.  
  820.         ## Has the user specified the developer configuration?
  821.         ## Note that the user still has the option of explicitly setting 
  822.         ## a path option.
  823.     "run_in_place" )
  824.       ## Make sure the value given was either "yes" or "no".
  825.       case "${val}" in
  826.         y | ye | yes )    val=yes ;;
  827.         n | no )        val=no  ;;
  828.         * )
  829.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  830. Set it to either \`yes' or \`no'."
  831.            echo "${short_usage}") >&2
  832.           exit 1
  833.         ;;
  834.       esac
  835.           eval "${opt}=\"${val}\""
  836.         ;;
  837.  
  838.     ## Has the user specified one of the path options?
  839.     prefix | exec_prefix | bindir | datadir | statedir | libdir | \
  840.     mandir | infodir | lispdir | etcdir | lockdir | archlibdir | \
  841.     sitelispdir | docdir )
  842.        ## If the value was omitted, get it from the next argument.
  843.        if [ "${valomitted}" = "yes" ]; then
  844.           if [ $# = 0 ]; then
  845.          (echo \
  846. "$progname: You must give a value for the \`--${optname}' option,";
  847.           echo \
  848. "as in \`--${optname}=`eval echo '$'$optname`.'"
  849.           echo "$short_usage") >&2
  850.          exit 1
  851.           fi
  852.           val="$1"; shift
  853.        fi
  854.        eval "${opt}=\"${val}\""
  855.     ;;
  856.  
  857.     ## Has the user specified values to override CFLAGS?
  858.     cflags )
  859.        ## If the value was omitted, get it from the next argument.
  860.        if [ "${valomitted}" = "yes" ]; then
  861.           if [ $# = 0 ]; then
  862.          (echo \
  863. "$progname: You must give a value for the \`--${optname}' option,";
  864.           echo \
  865. "as in \`--${optname}=`eval echo '$'$optname`-g -O'"
  866.           echo "$short_usage") >&2
  867.          exit 1
  868.           fi
  869.           val="$1"; shift
  870.        fi
  871.        eval "${opt}=\"${val}\""
  872.        eval "${opt}_specified=1"
  873.     ;;
  874.  
  875.     ## Verbose flag, tested by autoconf macros.
  876.     "verbose" )
  877.       verbose=yes
  878.     ;;
  879.  
  880.     ## --no-create added by autoconf for use by config.status
  881.     "no_create" )
  882.     ;;
  883.  
  884.     ## Has the user asked for some help?
  885.     "usage" | "help" )
  886.       if [ "x$PAGER" = x ]
  887.       then
  888.         echo "${short_usage}" | more
  889.       else
  890.         echo "${short_usage}" | $PAGER
  891.       fi
  892.       exit
  893.     ;;
  894.  
  895.     ## Has the user specified what toolkit to use for the menubars,
  896.     ## scrollbar or dialogs?
  897.     "with_menubars" | "with_scrollbars" | "with_dialogs" )
  898.       ## value can be lucid, motif, or athena.
  899.       case "${val}" in
  900.         l | lu | luc | luci | lucid )        val=lucid  ;;
  901.         m | mo | mot | moti | motif )        val=motif  ;;
  902.         a | at | ath | athe | athen | athena )    val=athena ;;
  903.         * )
  904.           (echo "${progname}: the \`--${optname}' option should have one of the values \`lucid', \`motif', or \`athena'."
  905.            echo "${short_usage}") >&2
  906.           exit 1
  907.         ;;
  908.       esac
  909.       eval "${opt}=\"${val}\""
  910.     ;;
  911.  
  912.     ## Has the user specified whether or not they want to use ToolTalk?
  913.     "with_tooltalk" )
  914.       ## Make sure the value given was either "yes" or "no".
  915.       case "${val}" in
  916.         y | ye | yes )    val=yes ;;
  917.         n | no )        val=no  ;;
  918.         * )
  919.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  920. Set it to either \`yes' or \`no'."
  921.            echo "${short_usage}") >&2
  922.           exit 1
  923.         ;;
  924.       esac
  925.           eval "${opt}=\"${val}\""
  926.         ;;
  927.  
  928.     ## Has the user specified whether or not they want I18N3?
  929.     "with_i18n3" )
  930.       ## Make sure the value given was either "yes" or "no".
  931.       case "${val}" in
  932.         y | ye | yes )    val=yes ;;
  933.         n | no )        val=no  ;;
  934.         * )
  935.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  936. Set it to either \`yes' or \`no'."
  937.            echo "${short_usage}") >&2
  938.           exit 1
  939.         ;;
  940.       esac
  941.           eval "${opt}=\"${val}\""
  942.         ;;
  943.  
  944.     ## Has the user specified whether or not they want Mule?
  945.     "with_mule" )
  946.       ## Make sure the value given was either "yes" or "no".
  947.       case "${val}" in
  948.         y | ye | yes )    val=yes ;;
  949.         n | no )        val=no  ;;
  950.         * )
  951.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  952. Set it to either \`yes' or \`no'."
  953.            echo "${short_usage}") >&2
  954.           exit 1
  955.         ;;
  956.       esac
  957.           eval "${opt}=\"${val}\""
  958.         ;;
  959.  
  960.     ## Has the user specified whether or not they want to use SparcWorks?
  961.     "with_sparcworks" )
  962.       ## Make sure the value given was either "yes" or "no".
  963.       case "${val}" in
  964.         y | ye | yes )    val=yes ;;
  965.         n | no )        val=no  ;;
  966.         * )
  967.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  968. Set it to either \`yes' or \`no'."
  969.            echo "${short_usage}") >&2
  970.           exit 1
  971.         ;;
  972.       esac
  973.           eval "${opt}=\"${val}\""
  974.       if [ "${with_sparcworks}" = "yes" ]; then
  975.             with_tooltalk='yes'
  976.       fi
  977.         ;;
  978.  
  979.     ## Does the user want usage tracking?
  980.     "usage_tracking" )
  981.       ## Make sure the value given was either "yes" or "no".
  982.       case "${val}" in
  983.         y | ye | yes )    val=yes ;;
  984.         n | no )        val=no  ;;
  985.         * )
  986.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  987. Set it to either \`yes' or \`no'."
  988.            echo "${short_usage}") >&2
  989.           exit 1
  990.         ;;
  991.       esac
  992.           eval "${opt}=\"${val}\""
  993.         ;;
  994.  
  995.     ## Does the user want additional debugging capability?
  996.     "debug" )
  997.       ## Make sure the value given was either "yes" or "no".
  998.       case "${val}" in
  999.         y | ye | yes )    val=yes ;;
  1000.         n | no )        val=no  ;;
  1001.         * )
  1002.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  1003. Set it to either \`yes' or \`no'."
  1004.            echo "${short_usage}") >&2
  1005.           exit 1
  1006.         ;;
  1007.       esac
  1008.           eval "${opt}=\"${val}\""
  1009.           if [ "${debug}" = "yes" ]; then
  1010.             use_assertions='yes'
  1011.           fi
  1012.         ;;
  1013.  
  1014.     ## Has the user specified whether or not they want to use Energize?
  1015.     "with_energize" )
  1016.       ## Make sure the value given was either "yes" or "no".
  1017.       case "${val}" in
  1018.         y | ye | yes )    val=yes ;;
  1019.         n | no )        val=no  ;;
  1020.         * )
  1021.           (echo "${progname}: the \`--${optname}' option is supposed to have a boolean value.
  1022. Set it to either \`yes' or \`no'."
  1023.            echo "${short_usage}") >&2
  1024.           exit 1
  1025.         ;;
  1026.       esac
  1027.           eval "${opt}=\"${val}\""
  1028.       if [ "${with_energize}" = "yes" ]; then
  1029.         with_menubars='lucid'
  1030.         with_scrollbars='motif'
  1031.         with_dialogs='motif'
  1032.         with_tooltalk='yes'
  1033.         internal_makefile_list="$internal_makefile_list lwlib/energize/Makefile.in"
  1034.       fi
  1035.         ;;
  1036.  
  1037.         ## Fail on unrecognized arguments.
  1038.     * )
  1039.       (echo "${progname}: Error: unrecognized option ${arg}"
  1040.        echo ""
  1041.            echo "${short_usage}") >& 2
  1042.       exit 1
  1043.     ;;
  1044.  
  1045.       esac
  1046.     ;;
  1047.  
  1048.     ## Anything not starting with a hyphen we assume is a
  1049.     ## configuration name.
  1050.     *)
  1051.       configuration=${arg}
  1052.     ;;
  1053.  
  1054.   esac
  1055. done
  1056.  
  1057. ### Get the arguments back.  See the diatribe on Shell Magic above.
  1058. eval set x "$quoted_arguments"; shift
  1059.  
  1060. if [ "${configuration}" = "" ]; then
  1061.   echo '- You did not tell me what kind of host system you want to configure.
  1062. - I will attempt to guess the kind of system this is.' 1>&2
  1063.   guesssys=`echo ${progname} | sed 's/configure$/config.guess/'`
  1064.   if configuration=`${CONFIG_SHELL-/bin/sh} ${guesssys}` ; then
  1065.     echo "- Looks like this is a ${configuration}" 1>&2
  1066.   else
  1067.     echo '- Failed to guess the system type.  You need to tell me.' 1>&2
  1068.     echo "${short_usage}" >&2
  1069.     exit 1
  1070.   fi
  1071. fi
  1072.  
  1073. #### Decide where the source is.
  1074. case "${srcdir}" in
  1075.  
  1076.   ## If it's not specified, see if  `.' or `..' might work.
  1077.   "" )
  1078.     confdir=`echo $0 | sed 's|//|/|' | sed 's|/[^/]*$||'`
  1079.     if [ -f $confdir/src/lisp.h -a -f $confdir/lisp/version.el ]; then
  1080.       srcdir="${confdir}"
  1081.     else
  1082.       if [ -f "./src/lisp.h" -a -f "./lisp/version.el" ]; then
  1083.         srcdir='.'
  1084.       else
  1085.         if [ -f "../src/lisp.h" -a -f "../lisp/version.el" ]; then
  1086.       srcdir='..'
  1087.         else
  1088.       (echo "\
  1089. ${progname}: Neither the current directory nor its parent seem to
  1090. contain the XEmacs sources.  If you do not want to build XEmacs in its
  1091. source tree, you should run \`${progname}' in the directory in which
  1092. you wish to build XEmacs, using its \`--srcdir' option to say where the
  1093. sources may be found."
  1094.         echo "${short_usage}") >&2
  1095.       exit 1
  1096.         fi
  1097.       fi
  1098.     fi
  1099.   ;;
  1100.  
  1101.   ## Otherwise, check if the directory they specified is okay.
  1102.   * )
  1103.     if [ ! -d "${srcdir}" -o ! -f "${srcdir}/src/lisp.h" -o ! -f "${srcdir}/lisp/version.el" ]; then
  1104.       (echo "\
  1105. ${progname}: The directory specified with the \`--srcdir' option,
  1106. \`${srcdir}', doesn't seem to contain the XEmacs sources.  You should
  1107. either run the \`${progname}' script at the top of the XEmacs source
  1108. tree, or use the \`--srcdir' option to specify where the XEmacs sources
  1109. are."
  1110.        echo "${short_usage}") >&2
  1111.       exit 1
  1112.     fi
  1113.   ;;
  1114. esac
  1115.  
  1116. ## We check for this now instead of later when we check for other
  1117. ## programs because we need to use its return value now.
  1118. ] AC_LN_S [
  1119.  
  1120. #### Make symlinks for etc, lisp, and info directories while the path
  1121. #### is still relative.  We don't symlink lock because someone may
  1122. #### have stuck the source on a read-only partition.  Instead we'll
  1123. #### create it as an actual directory later on if it doesn't already
  1124. #### exist.
  1125. for dir in etc lisp info
  1126. do
  1127.   if [ ! -d $dir ]; then
  1128.     echo Making symbolic link to ${srcdir}/$dir
  1129.     ${LN_S} ${srcdir}/$dir .
  1130.   fi
  1131. done
  1132.  
  1133. #### Make srcdir absolute, if it isn't already.  It's important to
  1134. #### avoid running the path through pwd unnecessary, since pwd can
  1135. #### give you automounter prefixes, which can go away.
  1136. case "${srcdir}" in
  1137.   /* ) ;;
  1138.   . )
  1139.     ## We may be able to use the $PWD environment variable to make this
  1140.     ## absolute.  But sometimes PWD is inaccurate.
  1141.     if [ "${PWD}" != "" ] && [ "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ] ; then
  1142.       srcdir="$PWD"
  1143.     else
  1144.       srcdir="`(cd ${srcdir}; pwd)`"
  1145.     fi
  1146.   ;;
  1147.   *  ) srcdir="`(cd ${srcdir}; pwd)`" ;;
  1148. esac
  1149.  
  1150. #### Check if the source directory already has a configured system in it.
  1151. if [ `pwd` != `sh -c cd ${srcdir} && pwd` ] \
  1152.    && [ -f "${srcdir}/src/config.h" ] ; then
  1153.   (echo "${progname}: WARNING: The directory tree \`${srcdir}' is being used"
  1154.    echo "   as a build directory right now; it has been configured in its own"
  1155.    echo "   right.  To configure in another directory as well, you MUST"
  1156.    echo "   use GNU make.  If you do not have GNU make, then you must"
  1157.    echo "   now do \`make distclean' in ${srcdir},"
  1158.    echo "   and then run ${progname} again.") >&2
  1159.   extrasub='/^VPATH[     ]*=/c\
  1160. vpath %.c $(srcdir)\
  1161. vpath %.h $(srcdir)\
  1162. vpath %.y $(srcdir)\
  1163. vpath %.l $(srcdir)\
  1164. vpath %.s $(srcdir)\
  1165. vpath %.in $(srcdir)'
  1166. fi
  1167.  
  1168. ### Make the necessary directories, if they don't exist.
  1169. for dir in ./src ./lib-src ./dynodump ./lwlib ./lock ; do
  1170.   if [ ! -d ${dir} ]; then
  1171.     mkdir ${dir}
  1172.   fi
  1173. done
  1174. if [ "${with_energize}" = "yes" ] && [ ! -d ./lwlib/energize ] ; then
  1175.   mkdir ./lwlib/energize
  1176. fi
  1177.  
  1178. #### Given the configuration name, set machfile and opsysfile to the
  1179. #### names of the m/*.h and s/*.h files we should use.
  1180.  
  1181. ### Canonicalize the configuration name.
  1182. echo "checking the configuration name"
  1183. # allow -energize prefix on configuration name
  1184. internal_configuration=`echo ${configuration} | sed 's/-energize//'`
  1185. # allow --sparcworks prefix on configuration name
  1186. internal_configuration=`echo ${configuration} | sed 's/-sparcworks//'`
  1187. if canonical=`${srcdir}/config.sub "${internal_configuration}"` ; then : ; else
  1188.   exit $?
  1189. fi
  1190.  
  1191. ### If you add support for a new configuration, add code to this
  1192. ### switch statement to recognize your configuration name and select
  1193. ### the appropriate operating system and machine description files.
  1194.  
  1195. ### You would hope that you could choose an m/*.h file pretty much
  1196. ### based on the machine portion of the configuration name, and an s-
  1197. ### file based on the operating system portion.  However, it turns out
  1198. ### that each m/*.h file is pretty manufacturer-specific - for
  1199. ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
  1200. ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
  1201. ### machines.  So we basically have to have a special case for each
  1202. ### configuration name.
  1203. ###
  1204. ### As far as handling version numbers on operating systems is
  1205. ### concerned, make sure things will fail in a fixable way.  If
  1206. ### /etc/MACHINES doesn't say anything about version numbers, be
  1207. ### prepared to handle anything reasonably.  If version numbers
  1208. ### matter, be sure /etc/MACHINES says something about it.
  1209. ###
  1210. ### Eric Raymond says we should accept strings like "sysvr4" to mean
  1211. ### "System V Release 4"; he writes, "The old convention encouraged
  1212. ### confusion between `system' and `release' levels'."
  1213.  
  1214. machine='' opsys='' unported=no need_dynodump=no
  1215. case "${canonical}" in
  1216.  
  1217.   ## NetBSD ports
  1218.   *-*-netbsd* )
  1219.     opsys=netbsd
  1220.     case "${canonical}" in
  1221.       sparc-*-netbsd*)        machine=sparc ;;
  1222.       i[345]86-*-netbsd*) machine=intel386 ;;
  1223.       hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* )
  1224.                       # Yes, this is somewhat bogus.
  1225.                       machine=hp9000s300 ;;
  1226.       pc532-*-netbsd* | ns32k-*-netbsd* )        machine=ns32000 ;;
  1227.       pmax-*-netbsd* | mips-*-netbsd* ) machine=pmax ;;
  1228.     esac
  1229.   ;;
  1230.  
  1231.   ## Acorn RISCiX:
  1232.   arm-acorn-riscix1.1* )
  1233.     machine=acorn opsys=riscix1-1
  1234.   ;;
  1235.   arm-acorn-riscix1.2* | arm-acorn-riscix )
  1236.     machine=acorn opsys=riscix1-2
  1237.   ;;
  1238.  
  1239.   ## Alliant machines
  1240.   ## Strictly speaking, we need the version of the alliant operating
  1241.   ## system to choose the right machine file, but currently the
  1242.   ## configuration name doesn't tell us enough to choose the right
  1243.   ## one; we need to give alliants their own operating system name to
  1244.   ## do this right.  When someone cares, they can help us.
  1245.   fx80-alliant-* )
  1246.     machine=alliant4 opsys=bsd4-2
  1247.   ;;
  1248.   i860-alliant-* )
  1249.     machine=alliant-2800 opsys=bsd4-3
  1250.   ;;
  1251.  
  1252.   ## DECstations (XEmacs change)
  1253.   alpha-dec-osf1.3 | alpha-dec-osf2* )
  1254.     machine=alpha opsys=decosf1-3
  1255.   ;;
  1256.   alpha-dec-osf1.2 | alpha-dec-osf1* )
  1257.     machine=alpha opsys=decosf1-2
  1258.   ;;
  1259.  
  1260.   ## Add switch for OSF 1 version 3 (roth@cse.ucsc.edu)
  1261.   alpha-dec-osf3.[2-9] )
  1262.     machine=alpha opsys=decosf3-2
  1263.   ;;
  1264.   alpha-dec-osf3* )
  1265.     machine=alpha opsys=decosf3-1
  1266.   ;;
  1267.  
  1268.   ## Altos 3068
  1269.   m68*-altos-sysv* )
  1270.     machine=altos opsys=usg5-2
  1271.   ;;
  1272.     
  1273.   ## Amdahl UTS
  1274.   580-amdahl-sysv* )
  1275.     machine=amdahl opsys=usg5-2-2
  1276.   ;;
  1277.  
  1278.   ## Apollo, Domain/OS
  1279.   m68*-apollo-* )
  1280.     machine=apollo opsys=bsd4-3
  1281.   ;;
  1282.   
  1283.   ## AT&T 3b2, 3b5, 3b15, 3b20
  1284.   we32k-att-sysv* )
  1285.     machine=att3b opsys=usg5-2-2
  1286.   ;;
  1287.  
  1288.   ## AT&T 3b1 - The Mighty Unix PC!
  1289.   m68*-att-sysv* )
  1290.     machine=7300 opsys=usg5-2-2
  1291.   ;;
  1292.  
  1293.   ## Bull dpx20
  1294.   rs6000-bull-bosx* )
  1295.     machine=ibmrs6000 opsys=aix3-2
  1296.   ;;
  1297.  
  1298.   ## Bull dpx2
  1299.   m68*-bull-sysv3* )
  1300.     machine=dpx2 opsys=usg5-3
  1301.   ;;
  1302.  
  1303.   ## Bull sps7
  1304.   m68*-bull-sysv2* )
  1305.     machine=sps7 opsys=usg5-2
  1306.   ;;
  1307.  
  1308.   ## CCI 5/32, 6/32 -- see "Tahoe".
  1309.  
  1310.   ## Celerity
  1311.   ## I don't know what configuration name to use for this; config.sub
  1312.   ## doesn't seem to know anything about it.  Hey, Celerity users, get
  1313.   ## in touch with us!
  1314.   celerity-celerity-bsd* )
  1315.     machine=celerity opsys=bsd4-2
  1316.   ;;
  1317.  
  1318.   ## Clipper
  1319.   ## What operating systems does this chip run that XEmacs has been
  1320.   ## tested on?
  1321.   clipper-* )
  1322.     machine=clipper
  1323.     ## We'll use the catch-all code at the bottom to guess the
  1324.     ## operating system.
  1325.   ;;
  1326.  
  1327.   ## Convex
  1328.   *-convex-bsd* | *-convex-convexos* )
  1329.     machine=convex opsys=bsd4-3
  1330.     ## Prevents suprious white space in makefiles - d.m.cooke@larc.nasa.gov
  1331.     NON_GNU_CPP="cc -E -P"
  1332.   ;;
  1333.  
  1334.   ## Cubix QBx/386
  1335.   i[345]86-cubix-sysv* )
  1336.     machine=intel386 opsys=usg5-3
  1337.   ;;
  1338.  
  1339.   ## Cydra 5
  1340.   cydra*-cydrome-sysv* )
  1341.     machine=cydra5 opsys=usg5-3
  1342.   ;;
  1343.  
  1344.   ## Data General AViiON Machines
  1345.   m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
  1346.     machine=aviion opsys=dgux5-4r3
  1347.   ;;
  1348.   m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
  1349.     machine=aviion opsys=dgux5-4r2
  1350.   ;;
  1351.   m88k-dg-dgux* )
  1352.     machine=aviion opsys=dgux
  1353.   ;;
  1354.  
  1355.   mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
  1356.     machine=pmax opsys=bsd4-2
  1357.   ;;
  1358.   mips-dec-ultrix* | mips-dec-bsd* )
  1359.     machine=pmax opsys=bsd4-3
  1360.   ;;
  1361.   mips-dec-osf* )
  1362.     machine=pmax opsys=osf1
  1363.   ;;
  1364.   mips-dec-mach* )
  1365.     machine=pmax opsys=mach
  1366.   ;;
  1367.  
  1368.   ## Motorola Delta machines
  1369.   m68k-motorola-sysv* | m68000-motorola-sysv* )
  1370.     machine=delta opsys=usg5-3
  1371.     if test -z "`type gnucc | grep 'not found'`"
  1372.     then
  1373.       if test -s /etc/167config
  1374.       then CC="gnucc -m68040"
  1375.       else CC="gnucc -m68881"
  1376.       fi 
  1377.     else
  1378.       if test -z "`type gcc | grep 'not found'`"
  1379.       then CC=gcc
  1380.       else CC=cc
  1381.       fi
  1382.     fi
  1383.   ;;
  1384.   m88k-motorola-sysv4* )
  1385.     # jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110
  1386.     # needs POSIX_SIGNALS and therefore needs usg5-4-2.
  1387.     # I hope there are not other 4.0 versions for this machine
  1388.     # which really need usg5-4 instead.
  1389.     machine=delta88k opsys=usg5-4-2
  1390.   ;;
  1391.   m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
  1392.     machine=delta88k opsys=usg5-3
  1393.   ;;
  1394.  
  1395.   ## Dual machines
  1396.   m68*-dual-sysv* )
  1397.     machine=dual opsys=usg5-2
  1398.   ;;
  1399.   m68*-dual-uniplus* )
  1400.     machine=dual opsys=unipl5-2
  1401.   ;;
  1402.  
  1403.   ## Elxsi 6400
  1404.   elxsi-elxsi-sysv* )
  1405.     machine=elxsi opsys=usg5-2
  1406.   ;;
  1407.  
  1408.   ## Encore machines
  1409.   ns16k-encore-bsd* )
  1410.     machine=ns16000 opsys=umax
  1411.   ;;
  1412.  
  1413.   ## The GEC 93 - apparently, this port isn't really finished yet.
  1414.  
  1415.   ## Gould Power Node and NP1
  1416.   pn-gould-bsd4.2* )
  1417.     machine=gould opsys=bsd4-2
  1418.   ;;
  1419.   pn-gould-bsd4.3* )
  1420.     machine=gould opsys=bsd4-3
  1421.   ;;
  1422.   np1-gould-bsd* )
  1423.     machine=gould-np1 opsys=bsd4-3
  1424.   ;;
  1425.  
  1426.   ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
  1427.   ## as far as XEmacs is concerned).
  1428.   m88k-harris-cxux* )
  1429.     # Build needs to be different on 7.0 and later releases
  1430.     case "`uname -r`" in
  1431.        [56].[0-9] ) machine=nh4000 opsys=cxux ;;
  1432.        [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
  1433.     esac
  1434.   ;;
  1435.   ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
  1436.   m68k-harris-cxux* )
  1437.     machine=nh3000 opsys=cxux
  1438.   ;;
  1439.  
  1440.   ## Honeywell XPS100
  1441.   xps*-honeywell-sysv* )
  1442.     machine=xps100 opsys=usg5-2
  1443.   ;;
  1444.  
  1445.   ## HP 9000 series 200 or 300
  1446.   m68*-hp-bsd* )
  1447.     machine=hp9000s300 opsys=bsd4-3
  1448.   ;;
  1449.   ## HP/UX 7, 8, 9, and 10 are supported on these machines.
  1450.   m68*-hp-hpux* )
  1451.     NON_GNU_CPP="cc -Aa -E"
  1452.     NON_GNU_CC="cc -Aa"
  1453.     case "`uname -r`" in
  1454.       ## Someone's system reports A.B8.05 for this.
  1455.       ## I wonder what other possibilities there are.
  1456.       *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
  1457.       *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
  1458.       *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
  1459.       *.10.* ) machine=hp9000s300 opsys=hpux10 ;;
  1460.       *) machine=hp9000s300 opsys=hpux ;;
  1461.     esac
  1462.   ;;
  1463.  
  1464.   ## HP 9000 series 700 and 800, running HP/UX
  1465.   hppa*-hp-hpux7* )
  1466.     machine=hp800 opsys=hpux NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1467.   ;;
  1468.   hppa*-hp-hpux8shr* )
  1469.     machine=hp800 opsys=hpux8shr NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1470.   ;;
  1471.   hppa*-hp-hpux8* )
  1472.     machine=hp800 opsys=hpux8 NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1473.   ;;
  1474.   hppa*-hp-hpux9shr* )
  1475.     machine=hp800 opsys=hpux9shr NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1476.   ;;
  1477.   hppa*-hp-hpux9* )
  1478.     machine=hp800 opsys=hpux9 NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1479.   ;;
  1480.   hppa*-hp-hpux10shr* )
  1481.     machine=hp800 opsys=hpux10shr NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1482.   ;;
  1483.   hppa*-hp-hpux10* )
  1484.     machine=hp800 opsys=hpux10 NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1485.   ;;
  1486.  
  1487.   ## HP 9000 series 700 and 800, running HP/UX
  1488.   hppa*-hp-hpux* )
  1489.     NON_GNU_CPP="cc -Aa -E" NON_GNU_CC="cc -Aa"
  1490.     ## Cross-compilation?  Nah!
  1491.     case "`uname -r`" in
  1492.       ## Someone's system reports A.B8.05 for this.
  1493.       ## I wonder what other possibilities there are.
  1494.       *.B8.* ) machine=hp800 opsys=hpux8 ;;
  1495.       *.08.* ) machine=hp800 opsys=hpux8 ;;
  1496.       *.09.* ) machine=hp800 opsys=hpux9 ;;
  1497.       *.10.* ) machine=hp800 opsys=hpux10 ;;
  1498.       *) machine=hp800 opsys=hpux ;;
  1499.     esac
  1500.   ;;
  1501.  
  1502.   ## Orion machines
  1503.   orion-orion-bsd* )
  1504.     machine=orion opsys=bsd4-2
  1505.   ;;
  1506.   clipper-orion-bsd* )
  1507.     machine=orion105 opsys=bsd4-2
  1508.   ;;
  1509.  
  1510.   ## IBM machines
  1511.   i[345]86-ibm-aix1.1* )
  1512.     machine=ibmps2-aix opsys=usg5-2-2
  1513.   ;;
  1514.   i[345]86-ibm-aix1.[23]* | i[345]86-ibm-aix* )
  1515.     machine=ibmps2-aix opsys=usg5-3
  1516.   ;;
  1517.   i370-ibm-aix*)
  1518.     machine=ibm370aix opsys=usg5-3
  1519.   ;;
  1520.   rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
  1521.     machine=ibmrs6000 opsys=aix3-1
  1522.   ;;
  1523.   rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
  1524.     machine=ibmrs6000 opsys=aix3-2-5
  1525.   ;;
  1526.   rs6000-ibm-aix4.1* | powerpc-ibm-aix4.1*  )
  1527.     machine=ibmrs6000 opsys=aix4-1
  1528.   ;;
  1529.   rs6000-ibm-aix4* | powerpc-ibm-aix4*  )
  1530.     machine=ibmrs6000 opsys=aix4
  1531.   ;;
  1532.   rs6000-ibm-aix* | powerpc-ibm-aix* )
  1533.     machine=ibmrs6000 opsys=aix3-2
  1534.   ;;
  1535.   romp-ibm-bsd4.3* )
  1536.     machine=ibmrt opsys=bsd4-3
  1537.   ;;    
  1538.   romp-ibm-bsd4.2* )
  1539.     machine=ibmrt opsys=bsd4-2
  1540.   ;;
  1541.   romp-ibm-aos4.3* )
  1542.     machine=ibmrt opsys=bsd4-3
  1543.   ;;    
  1544.   romp-ibm-aos4.2* )
  1545.     machine=ibmrt opsys=bsd4-2
  1546.   ;;
  1547.   romp-ibm-aos* )
  1548.     machine=ibmrt opsys=bsd4-3
  1549.   ;;
  1550.   romp-ibm-bsd* )
  1551.     machine=ibmrt opsys=bsd4-3
  1552.   ;;
  1553.   romp-ibm-aix* )
  1554.     machine=ibmrt-aix opsys=usg5-2-2
  1555.   ;;
  1556.   romp-ibm-mach* )
  1557.     machine=ibmrt opsys=mach
  1558.   ;;
  1559.  
  1560.   ## Integrated Solutions `Optimum V'
  1561.   m68*-isi-bsd4.2* )
  1562.     machine=isi-ov opsys=bsd4-2
  1563.   ;;
  1564.   m68*-isi-bsd4.3* )
  1565.     machine=isi-ov opsys=bsd4-3
  1566.   ;;
  1567.  
  1568.   ## Intel 386 machines where we do care about the manufacturer
  1569.   i[345]86-intsys-sysv* )
  1570.     machine=is386 opsys=usg5-2-2
  1571.   ;;
  1572.  
  1573.   ## Prime EXL
  1574.   i[345]86-prime-sysv* )
  1575.     machine=i386 opsys=usg5-3
  1576.   ;;
  1577.  
  1578.   ## Sequent Symmetry running Dynix
  1579.   i[345]86-sequent-bsd* )
  1580.     machine=symmetry opsys=bsd4-3
  1581.   ;;
  1582.  
  1583.   ## Sequent Symmetry running DYNIX/ptx
  1584.   ## Use the old cpp rather than the newer ANSI one.
  1585.   i[345]86-sequent-ptx* )
  1586.     machine=sequent-ptx opsys=ptx
  1587.     NON_GNU_CPP="/lib/cpp"
  1588.   ;;
  1589.  
  1590.   ## Unspecified sysv on an ncr machine defaults to svr4.2.
  1591.   ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
  1592.   i[345]86-ncr-sysv* )
  1593.     machine=ncr386 opsys=usg5-4-2
  1594.   ;;
  1595.  
  1596.   ## Intel Paragon OSF/1
  1597.   i860-intel-osf1* )
  1598.     machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp
  1599.   ;;
  1600.  
  1601.   ## Intel 860
  1602.   i860-*-sysv4* )
  1603.     machine=i860 opsys=usg5-4
  1604.     NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
  1605.     NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
  1606.   ;;
  1607.  
  1608.   ## Masscomp machines
  1609.   m68*-masscomp-rtu* )
  1610.     machine=masscomp opsys=rtu
  1611.   ;;
  1612.  
  1613.   ## Megatest machines
  1614.   m68*-megatest-bsd* )
  1615.     machine=mega68 opsys=bsd4-2
  1616.   ;;
  1617.  
  1618.   ## Workstations sold by MIPS
  1619.   ## This is not necessarily all workstations using the MIPS processor -
  1620.   ## Irises are produced by SGI, and DECstations by DEC.
  1621.  
  1622.   ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
  1623.   ## and usg5-2-2 and bsd4-3 as possible OS files.  The only guidance
  1624.   ## it gives for choosing between the alternatives seems to be "Use
  1625.   ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
  1626.   ## the BSD world."  I'll assume that these are instructions for
  1627.   ## handling two odd situations, and that every other situation
  1628.   ## should use mips.h and usg5-2-2, they being listed first.
  1629.   mips-mips-usg* )
  1630.     machine=mips4
  1631.     ## Fall through to the general code at the bottom to decide on the OS.
  1632.   ;;
  1633.   mips-mips-riscos4* )
  1634.     machine=mips4 opsys=bsd4-3
  1635.     NON_GNU_CC="cc -systype bsd43"
  1636.     NON_GNU_CPP="cc -systype bsd43 -E"
  1637.   ;;
  1638.   mips-mips-bsd* )
  1639.     machine=mips opsys=bsd4-3
  1640.   ;;
  1641.   mips-mips-* )
  1642.     machine=mips opsys=usg5-2-2
  1643.   ;;
  1644.  
  1645.   ## NeXT
  1646.   *-next-* )
  1647.     machine=next opsys=mach2
  1648.   ;;
  1649.  
  1650.   ## The complete machine from National Semiconductor
  1651.   ns32k-ns-genix* )
  1652.     machine=ns32000 opsys=usg5-2
  1653.   ;;
  1654.  
  1655.   ## NCR machines
  1656.   m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
  1657.     machine=tower32 opsys=usg5-2-2
  1658.   ;;
  1659.   m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
  1660.     machine=tower32v3 opsys=usg5-3
  1661.   ;;
  1662.  
  1663.   ## Nixdorf Targon 31
  1664.   m68*-nixdorf-sysv* )
  1665.     machine=targon31 opsys=usg5-2-2
  1666.   ;;
  1667.  
  1668.   ## Nu (TI or LMI)
  1669.   m68*-nu-sysv* )
  1670.     machine=nu opsys=usg5-2
  1671.   ;;
  1672.  
  1673.   ## Plexus
  1674.   m68*-plexus-sysv* )
  1675.     machine=plexus opsys=usg5-2
  1676.   ;;
  1677.  
  1678.   ## Pyramid machines
  1679.   ## I don't really have any idea what sort of processor the Pyramid has,
  1680.   ## so I'm assuming it is its own architecture.
  1681.   pyramid-pyramid-bsd* )
  1682.     machine=pyramid opsys=bsd4-2
  1683.   ;;
  1684.  
  1685.   ## Sequent Balance
  1686.   ns32k-sequent-bsd4.2* )
  1687.     machine=sequent opsys=bsd4-2
  1688.   ;;
  1689.   ns32k-sequent-bsd4.3* )
  1690.     machine=sequent opsys=bsd4-3
  1691.   ;;
  1692.  
  1693.   ## Siemens Nixdorf
  1694.   mips-siemens-sysv* )
  1695.     machine=mips-siemens opsys=usg5-4
  1696.     NON_GNU_CC=/usr/ccs/bin/cc
  1697.     NON_GNU_CPP=/usr/ccs/lib/cpp
  1698.   ;;
  1699.  
  1700.   ## Silicon Graphics machines
  1701.   ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
  1702.   m68*-sgi-iris3.5* )
  1703.     machine=irist opsys=iris3-5
  1704.   ;;
  1705.   m68*-sgi-iris3.6* | m68*-sgi-iris*)
  1706.     machine=irist opsys=iris3-6
  1707.   ;;
  1708.   ## Iris 4D
  1709.   mips-sgi-irix3.* )
  1710.     machine=iris4d opsys=irix3-3
  1711.   ;;
  1712.   mips-sgi-irix4.* )
  1713.     machine=iris4d opsys=irix4-0
  1714.   ;;
  1715.   mips-sgi-irix6* )
  1716.     machine=iris4d opsys=irix6-0
  1717.   ;;
  1718.   mips-sgi-irix5.[3-9]* )
  1719.     machine=iris4d opsys=irix5-3
  1720.   ;;
  1721.   mips-sgi-irix5.2* )
  1722.     machine=iris4d opsys=irix5-2
  1723.   ;;
  1724.   mips-sgi-irix5.1* )
  1725.     machine=iris4d opsys=irix5-1
  1726.   ;;
  1727.   mips-sgi-irix5.* | mips-sgi-irix* )
  1728.     machine=iris4d opsys=irix5-0
  1729.   ;;
  1730.  
  1731.   ## SONY machines
  1732.   m68*-sony-bsd4.2* )
  1733.     machine=news opsys=bsd4-2
  1734.   ;;
  1735.   m68*-sony-bsd4.3* )
  1736.     machine=news opsys=bsd4-3
  1737.   ;;
  1738.   m68*-sony-newsos3* | m68*-sony-news3*)
  1739.     machine=news opsys=bsd4-3
  1740.   ;;
  1741.   mips-sony-bsd* | mips-sony-newsos4* | mips-sony-news4*)
  1742.     machine=news-risc opsys=bsd4-3
  1743.   ;;
  1744.   mips-sony-news* )
  1745.     machine=news-risc opsys=newsos5
  1746.   ;;
  1747.  
  1748.   ## Stride
  1749.   m68*-stride-sysv* )
  1750.     machine=stride opsys=usg5-2
  1751.   ;;
  1752.  
  1753.   ## Suns
  1754.   *-sun-sunos* | *-sun-bsd* | *-sun-solaris* | i[345]86-*-solaris2* | i[345]86-*-sunos5* | *-sun-mach* )
  1755.     case "${canonical}" in
  1756.       m68*-sunos1* )    machine=sun1 ;;
  1757.       m68*-sunos2* )    machine=sun2 ;;
  1758.       m68* )        machine=sun3 ;;
  1759.       i[345]86*-sun-sunos[34]* )    machine=sun386 ;;
  1760.       i[345]86-*-* )    machine=intel386 ;;
  1761.       sparc* )        machine=sparc ;;
  1762.       * )        unported=yes ;;
  1763.     esac
  1764.     case "${canonical}" in
  1765.       ## The Sun386 didn't get past 4.0.
  1766.       i[345]86-*-sunos4      ) opsys=sunos4-0 ;;
  1767.       *-sunos4.0*      ) opsys=sunos4-0 ;;
  1768.       *-sunos4.1.2*       ) opsys=sunos4-1-2
  1769.         NON_GCC_TEST_OPTIONS=-Bstatic
  1770.         GCC_TEST_OPTIONS=-static
  1771.         ;;
  1772.       *-sunos4.1.[3-9]*      ) opsys=sunos4-1-3
  1773.         NON_GNU_CPP=/usr/lib/cpp
  1774.         ;;
  1775.       *-sunos4shr*      ) opsys=sunos4-0shr ;;
  1776.       *-sunos4-0shr*      ) opsys=sunos4-0shr ;;
  1777.       *-sunos4-1shr*      ) opsys=sunos4-1shr
  1778.         NON_GCC_TEST_OPTIONS=-Bstatic
  1779.         GCC_TEST_OPTIONS=-static
  1780.         ;;
  1781.       *-sunos4-1-2shr*      ) opsys=sunos4-1-2shr
  1782.         NON_GCC_TEST_OPTIONS=-Bstatic
  1783.         GCC_TEST_OPTIONS=-static
  1784.         ;;
  1785.       *-sunos4-1-[3-9]shr*      ) opsys=sunos4-1-3shr
  1786.         NON_GNU_CPP=/usr/lib/cpp
  1787.         ;;
  1788.       *-sunos4* | *-sunos ) opsys=sunos4-1
  1789.         NON_GCC_TEST_OPTIONS=-Bstatic
  1790.         GCC_TEST_OPTIONS=-static
  1791.         ;;
  1792.       *-sunos5.3* | *-solaris2.3* )
  1793.         opsys=sol2-3
  1794.         need_dynodump=yes
  1795.         NON_GNU_CPP=/usr/ccs/lib/cpp
  1796.         ;;
  1797.       *-sunos5.4* | *-solaris2.4* )
  1798.         opsys=sol2-4
  1799.         need_dynodump=yes
  1800.         NON_GNU_CPP=/usr/ccs/lib/cpp
  1801.         ;;
  1802.       *-sunos5.[5-9]* | *-solaris2.[5-9]* )
  1803.         opsys=sol2-5
  1804.         need_dynodump=yes
  1805.         NON_GNU_CPP=/usr/ccs/lib/cpp
  1806.         ;;
  1807.       *-sunos5* | *-solaris* )
  1808.         opsys=sol2
  1809.         need_dynodump=yes
  1810.         NON_GNU_CPP=/usr/ccs/lib/cpp
  1811.         ;;
  1812.       *-mach*          ) opsys=mach ;;
  1813.       *              ) opsys=bsd4-2 ;;
  1814.     esac
  1815.   ;;
  1816.  
  1817.   ## Tadpole 68k
  1818.   m68*-tadpole-sysv* )
  1819.     machine=tad68k opsys=usg5-3
  1820.   ;;
  1821.  
  1822.   ## Tahoe machines
  1823.   tahoe-tahoe-bsd4.2* )
  1824.     machine=tahoe opsys=bsd4-2
  1825.   ;;
  1826.   tahoe-tahoe-bsd4.3* )
  1827.     machine=tahoe opsys=bsd4-3
  1828.   ;;
  1829.  
  1830.   ## Tandem Integrity S2
  1831.   mips-tandem-sysv* )
  1832.     machine=tandem-s2 opsys=usg5-3
  1833.   ;;
  1834.  
  1835.   ## Tektronix XD88
  1836.   m88k-tektronix-sysv3* )
  1837.   machine=tekxd88 opsys=usg5-3
  1838.   ;;
  1839.  
  1840.   ## Tektronix 16000 box (6130?)
  1841.   ns16k-tektronix-bsd* )
  1842.     machine=ns16000 opsys=bsd4-2
  1843.   ;;
  1844.   ## Tektronix 4300
  1845.   ## src/m/tek4300.h hints that this is a m68k machine.
  1846.   m68*-tektronix-bsd* )
  1847.     machine=tek4300 opsys=bsd4-3
  1848.   ;;
  1849.  
  1850.   ## Titan P2 or P3
  1851.   ## We seem to have lost the machine-description file titan.h!
  1852.   titan-titan-sysv* )
  1853.     machine=titan opsys=usg5-3
  1854.   ;;
  1855.   
  1856.   ## Ustation E30 (SS5E)
  1857.   m68*-unisys-uniplus* )
  1858.     machine=ustation opsystem=unipl5-2
  1859.   ;;
  1860.  
  1861.   ## Vaxen.
  1862.   vax-dec-* )
  1863.     machine=vax
  1864.     case "${canonical}" in
  1865.       *-bsd4.1* )                     opsys=bsd4-1 ;;
  1866.       *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* )    opsys=bsd4-2 ;;
  1867.       *-bsd4.3* | *-ultrix* )                 opsys=bsd4-3 ;;
  1868.       *-sysv[01]* | *-sysvr[01]* )             opsys=usg5-0 ;;
  1869.       *-sysv2* | *-sysvr2* )                opsys=usg5-2 ;;
  1870.       *-vms* )                         opsys=vms ;;
  1871.       *-mach* )                        opsys=mach ;;
  1872.       * )                         unported=yes
  1873.     esac
  1874.   ;;
  1875.  
  1876.   ## Whitechapel MG1
  1877.   ns16k-whitechapel-* )
  1878.     machine=mg1
  1879.     ## We don't know what sort of OS runs on these; we'll let the
  1880.     ## operating system guessing code below try.
  1881.   ;;
  1882.  
  1883.   ## Wicat
  1884.   m68*-wicat-sysv* )
  1885.     machine=wicat opsys=usg5-2
  1886.   ;;
  1887.  
  1888.   ## Intel 386 machines where we don't care about the manufacturer
  1889.   i[345]86-*-* )
  1890.     machine=intel386
  1891.     case "${canonical}" in
  1892.       *-isc1.* | *-isc2.[01]* )    opsys=386-ix ;;
  1893.       *-isc2.2* )        opsys=isc2-2 ;;
  1894.       *-isc4.0* )        opsys=isc4-0 ;;
  1895.       *-isc* )            opsys=isc3-0 ;;
  1896.       *-esix5* )        opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
  1897.       *-esix* )            opsys=esix ;;
  1898.       *-mach* )            opsys=mach ;;
  1899.       *-xenix* )        opsys=xenix ;;
  1900.       *-linux*1.1.5[6-9]* | *-linux*1.1.[6-9]* | *-linux*1.[2-9]* )
  1901.                 opsys=linux1-1-56 ;;
  1902.       *-linux* )        opsys=linux-old ;;
  1903.       *-sco3.2v4* )        opsys=sco4 ; NON_GNU_CPP=/lib/cpp  ;;
  1904.       *-bsd386* | *-bsdi1* )    opsys=bsd386 ;;
  1905.       *-bsdi2* )        opsys=bsdos2 ;;
  1906.       *-sco3.2v5* )        opsys=sco5 ; NON_GNU_CPP="/lib/cpp -D_XOPEN_SOURCE"  ;;
  1907.       *-386bsd* )            opsys=386bsd ;;
  1908.       *-freebsd* )        opsys=freebsd ;;
  1909.       *-nextstep* )        opsys=mach2 ;;
  1910.       ## Otherwise, we'll fall through to the generic opsys code at the bottom.
  1911.     esac
  1912.   ;;
  1913.  
  1914.   * )
  1915.     unported=yes
  1916.   ;;
  1917. esac
  1918.  
  1919. ### If the code above didn't choose an operating system, just choose
  1920. ### an operating system based on the configuration name.  You really
  1921. ### only want to use this when you have no idea what the right
  1922. ### operating system is; if you know what operating systems a machine
  1923. ### runs, it's cleaner to make it explicit in the case statement
  1924. ### above.
  1925. if [ x"${opsys}" = x ]; then
  1926.   case "${canonical}" in
  1927.     *-gnu* )                opsys=gnu ;;
  1928.     *-bsd4.[01] )            opsys=bsd4-1 ;;
  1929.     *-bsd4.2 )                opsys=bsd4-2 ;;
  1930.     *-bsd4.3 )                opsys=bsd4-3 ;;
  1931.     *-sysv0 | *-sysvr0 )        opsys=usg5-0 ;;
  1932.     *-sysv2 | *-sysvr2 )        opsys=usg5-2 ;;
  1933.     *-sysv2.2 | *-sysvr2.2 )        opsys=usg5-2-2 ;;
  1934.     *-sysv3 | *-sysvr3 )        opsys=usg5-3 ;;
  1935.     *-sysv4 | *-sysvr4 )        opsys=usg5-4 ;;
  1936.     *-sysv4.1 | *-sysvr4.1 )
  1937.       NON_GNU_CPP=/usr/lib/cpp
  1938.       opsys=usg5-4 ;;
  1939.     *-sysv4.2 | *-sysvr4.2 )
  1940.     if [ x$NON_GNU_CPP = x ]; then
  1941.       NON_GNU_CPP=/usr/ccs/lib/cpp
  1942.     fi
  1943.     opsys=usg5-4-2 ;;
  1944.     * )
  1945.       unported=yes
  1946.     ;;
  1947.   esac
  1948. fi
  1949.  
  1950. if [ "${unported}" = "yes" ]; then
  1951.   (echo "${progname}: XEmacs hasn't been ported to \`${canonical}' systems."
  1952.    echo "${progname}: Check \`etc/MACHINES' for recognized configuration names."
  1953.   ) >&2
  1954.   exit 1
  1955. fi
  1956.  
  1957. if [ "${dynamic}" = "yes" ]; then
  1958.   case "${opsys}" in
  1959.     hpux8        ) opsys=hpux8shr ;;
  1960.     hpux9        ) opsys=hpux9shr ;;
  1961.     hpux10        ) opsys=hpux10shr ;;
  1962.     sunos4-0        ) opsys=sunos4-0shr ;;
  1963.     sunos4-1        ) opsys=sunos4-1shr ;;
  1964.     sunos4-1-2    ) opsys=sunos4-1-2shr ;;
  1965.     sunos4-1-3    ) opsys=sunos4-1-3shr ;;
  1966.   esac
  1967. elif [ "${dynamic}" = "no" ]; then
  1968.   case "${opsys}" in
  1969.     sol2    )    opsys=sol2-static ;;
  1970.     sol2-3    )    opsys=sol2-3-static ;;
  1971.     sol2-4    )    opsys=sol2-4-static ;;
  1972.     decosf1-3    )    opsys=decosf1-3-static ;;
  1973.     decosf3-1    )    opsys=decosf3-1-static ;;
  1974.   esac
  1975. fi
  1976.  
  1977. dynodump_arch=''
  1978. if [ "${need_dynodump}" = "yes" ]; then
  1979.   case "${canonical}" in
  1980.     sparc-*-* )        dynodump_arch=sparc ;;
  1981.     powerpc-*-* )    dynodump_arch=powerpc ;;
  1982.     i[345]86-*-* )    dynodump_arch=i386 ;;
  1983.   esac
  1984. fi
  1985.  
  1986. machfile="m/${machine}.h"
  1987. opsysfile="s/${opsys}.h"
  1988.  
  1989. ]
  1990. AC_LANG_C
  1991. AC_PREPARE(lisp)
  1992. AC_CONFIG_HEADER(src/config.h)
  1993. [
  1994.  
  1995. #### Choose a compiler.
  1996. if [ "x$CC" = x ] ; then
  1997.   cc_specified=1
  1998. fi
  1999.  
  2000. if [ "${with_gcc}" = "yes" ] ; then
  2001.   CC="${compiler-gcc}"
  2002.   GCC=1
  2003. elif [ "${with_lcc}" = "yes" ] ; then
  2004.   CC="${compiler-lcc}"
  2005.   dash_r_space=' '        # this bullshit is here because lcc for solaris
  2006.                 # will not accept -Rargument.
  2007.                 # It needs -R argument instead.  Yuck yuck yuck.
  2008.   if [ "x$NON_GNU_CPP" = x ] ; then
  2009.     NON_GNU_CPP="yes"        # this is handled specially below...
  2010.   fi
  2011. elif [ "${compiler}" != "" ] ; then
  2012.   CC="${compiler}"
  2013. elif [ "${with_gcc}" = "no" ] ; then
  2014.   CC="cc"
  2015. elif [ "${with_lcc}" = "no" ] ; then
  2016.   if [ "x$CC" = x ]
  2017.   then CC=cc;
  2018.   else true;
  2019.   fi
  2020. else
  2021.   case "${canonical}" in
  2022.     * )
  2023.       ] AC_PROG_CC [
  2024.       if [ "${CC}" = "gcc" ] ; then
  2025.         with_gcc="yes"
  2026.         GCC=1
  2027.       fi
  2028.     ;;
  2029.   esac
  2030. fi
  2031.  
  2032. # On Suns, sometimes $CPP names a directory.
  2033. if [ -n "$CPP" ] && [ -d "$CPP" ] ; then
  2034.   CPP=
  2035. fi
  2036.  
  2037. #### Some systems specify a CPP to use unless we are using GCC.
  2038. #### Now that we know whether we are using GCC, we can decide whether
  2039. #### to use that one.
  2040. if [ "x$NON_GNU_CPP" = x ] || [ x$GCC = x1 ]
  2041. then true
  2042. else
  2043.   if [ "x$CPP" = x ]; then
  2044.     if [ "${with_lcc}" = "yes" ] && [ "${NON_GNU_CPP}" = "yes" ] ; then
  2045.       CPP='gcc -E -traditional' # cross fingers and hope it's there....
  2046.     else
  2047.       CPP="$NON_GNU_CPP"
  2048.     fi
  2049.   fi
  2050. fi
  2051.  
  2052. #### Some systems specify a CC to use unless we are using GCC.
  2053. #### Now that we know whether we are using GCC, we can decide whether
  2054. #### to use that one.
  2055. if [ "x$NON_GNU_CC" = x ] || [ x$GCC = x1 ] || [ x$cc_specified = x1 ]
  2056. then true
  2057. else
  2058.   CC="$NON_GNU_CC"
  2059. fi
  2060.  
  2061. ## Huh?  I commented out the following because it always enabled
  2062. ## the "test" options, whatever the hell those are supposed to be
  2063. ## for, and the result is that SunOS builds were always static.
  2064.  
  2065. #if [ x$GCC = x1 ] && [ "x$GCC_TEST_OPTIONS" != x ]
  2066. #then
  2067. #  CC="$CC $GCC_TEST_OPTIONS"
  2068. #fi  
  2069. #
  2070. #if [ x$GCC = x ] && [ "x$NON_GCC_TEST_OPTIONS" != x ]
  2071. #then
  2072. #  CC="$CC $NON_GCC_TEST_OPTIONS"
  2073. #fi  
  2074.  
  2075. #### Some other nice autoconf tests.  If you add a test here which
  2076. #### should make an entry in src/config.h, don't forget to add an
  2077. #### #undef clause to src/config.h.in for autoconf to modify.
  2078. ]
  2079. dnl checks for programs
  2080. AC_PROG_CPP
  2081. [
  2082. case "${canonical}" in
  2083.   *-sun-sunos* )
  2084.     if [ "${CPP}" = "acc -E" ] ; then
  2085.       CPP="acc -E -Xs"
  2086.     fi
  2087.   ;;
  2088. esac
  2089. ]
  2090. AC_PROG_RANLIB
  2091. AC_PROG_INSTALL
  2092. AC_PROG_YACC
  2093.  
  2094. dnl checks for UNIX variants that set `DEFS'
  2095.  
  2096. dnl checks for header files
  2097. AC_HAVE_HEADERS(mach/mach.h sys/timeb.h sys/time.h unistd.h utime.h sys/wait.h)
  2098. AC_STDC_HEADERS
  2099. AC_TIME_WITH_SYS_TIME
  2100. AC_SYS_SIGLIST_DECLARED
  2101.  
  2102. dnl Some systems have utime.h but don't declare the struct anyplace.
  2103. AC_COMPILE_CHECK(struct utimbuf,
  2104. [#ifdef TIME_WITH_SYS_TIME
  2105. #include <sys/time.h>
  2106. #include <time.h>
  2107. #else
  2108. #ifdef HAVE_SYS_TIME_H
  2109. #include <sys/time.h>
  2110. #else
  2111. #include <time.h>
  2112. #endif
  2113. #endif
  2114. #ifdef HAVE_UTIME_H
  2115. #include <utime.h>
  2116. #endif], [static struct utimbuf x; x.actime = x.modtime;],
  2117.   AC_DEFINE(HAVE_STRUCT_UTIMBUF))
  2118.  
  2119. dnl checks for typedefs
  2120. AC_RETSIGTYPE
  2121.  
  2122. AC_COMPILE_CHECK(struct timeval,
  2123. [#ifdef TIME_WITH_SYS_TIME
  2124. #include <sys/time.h>
  2125. #include <time.h>
  2126. #else
  2127. #ifdef HAVE_SYS_TIME_H
  2128. #include <sys/time.h>
  2129. #else
  2130. #include <time.h>
  2131. #endif
  2132. #endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
  2133.    AC_DEFINE(HAVE_TIMEVAL))
  2134.  
  2135. dnl checks for structure members
  2136. AC_STRUCT_TM
  2137. AC_TIMEZONE
  2138.  
  2139. dnl check for Make feature
  2140. AC_SET_MAKE
  2141.  
  2142. dnl check byte order
  2143. AC_WORDS_BIGENDIAN
  2144.  
  2145. dnl check for long file names
  2146. AC_LONG_FILE_NAMES
  2147.  
  2148. dnl other checks for UNIX variants
  2149. [
  2150. # What the hell was this doing here??????
  2151. ### echo > confdefs.h        # this gets nuked above...
  2152.  
  2153. #### Choose a window system.
  2154. echo "checking for specified window system"
  2155.  
  2156. window_system=''
  2157. case "${with_x11}" in
  2158.   yes )
  2159.     window_system=${window_system}x11
  2160.   ;;
  2161.   no )
  2162.     window_system=${window_system}none
  2163. esac
  2164.  
  2165. case "${window_system}" in
  2166.   "none" | "x11" ) ;;
  2167.   "" )
  2168.     # --x-includes or --x-libraries implies --with-x11.
  2169.     if [ -n "${x_includes}" ] || [ -n "${x_libraries}" ]; then
  2170.       window_system=x11
  2171.     else
  2172.       echo "  No window system specified.  Looking for X11."
  2173.       # If the user didn't specify a window system and we found X11, use it.
  2174.       if [ -r /usr/lib/libX11.a \
  2175.          -o -d /usr/include/X11 \
  2176.          -o -d /usr/X386/include \
  2177.          -o -d /usr/X11R6/include \
  2178.      -o -d ${x_includes}/X11 ]; then
  2179.         window_system=x11
  2180.       fi
  2181.     fi
  2182.   ;;
  2183.   * )
  2184.     echo "Don't specify a window system more than once." >&2
  2185.     exit 1
  2186.   ;;
  2187. esac
  2188.  
  2189. case "${window_system}" in
  2190.   "" | "x11" )
  2191.     ### If the user hasn't specified where we should find X, try
  2192.     ### letting autoconf figure that out.
  2193.     if [ -z "${x_includes}" ] && [ -z "${x_libraries}" ]; then
  2194.       ]
  2195.       AC_FIND_X
  2196.       [
  2197.     fi
  2198.     if [ -n "${x_includes}" ] || [ -n "${x_libraries}" ]; then
  2199.       window_system=x11
  2200.     fi
  2201.   ;;
  2202. esac
  2203.  
  2204. [ -z "${window_system}" ] && window_system=none
  2205.  
  2206. if [ "${window_system}" = "none" ]; then
  2207.   if [ "${with_epoch}" = "yes" ]; then
  2208.     ] AC_WARN(--with-epoch ignored:  Not valid without X support) [
  2209.     with_epoch='no'
  2210.   fi
  2211.   if [ "x${with_menubars}" != x ]; then
  2212.     ] AC_WARN(--with-menubars ignored:  Not valid without X support) [
  2213.     with_menubars='no'
  2214.   fi
  2215.   if [ "x${with_scrollbars}" != x ]; then
  2216.     ] AC_WARN(--with-scrollbars ignored:  Not valid without X support) [
  2217.     with_scrollbars='no'
  2218.   fi
  2219.   if [ "x${with_dialogs}" != x ]; then
  2220.     ] AC_WARN(--with-dialogs ignored:  Not valid without X support) [
  2221.     with_dialogs='no'
  2222.   fi
  2223.   with_menubars='no'
  2224.   with_scrollbars='no'
  2225.   with_dialogs='no'
  2226. fi
  2227.  
  2228. case "${canonical}" in
  2229.   *-sun-solaris* | *-sun-sunos5* ) add_runtime_flag=yes ;;
  2230. esac
  2231.  
  2232. if [ -n "${x_libraries}" ]; then
  2233.     if [ "${add_runtime_flag}" ]; then
  2234.     LD_SWITCH_X_SITE="-L${x_libraries} -R${dash_r_space}${x_libraries}"
  2235.     else
  2236.     LD_SWITCH_X_SITE="-L${x_libraries}"
  2237.     fi
  2238. fi
  2239. # LD_SWITCH_X_SITE_AUX (from FSF) is ill-conceived.  See s/sol2*.h.
  2240. # [ -n "${x_libraries}" ] && LD_SWITCH_X_SITE_AUX="-R${x_libraries}"
  2241. [ -n "${x_includes}" ] && C_SWITCH_X_SITE="-I${x_includes}"
  2242.  
  2243. if [ -n "${site_libraries}" ]; then
  2244.   for arg in ${site_libraries}
  2245.   do
  2246.     LD_SWITCH_SITE="${LD_SWITCH_SITE} -L${arg}"
  2247.   done
  2248. fi
  2249. if [ -n "${site_runtime_libraries}" ]; then
  2250.   for arg in ${site_runtime_libraries}
  2251.   do
  2252.     LD_SWITCH_SITE="${LD_SWITCH_SITE} -L${arg}"
  2253.     LD_SWITCH_SITE="${LD_SWITCH_SITE} -R${dash_r_space}${arg}"
  2254.   done
  2255. fi
  2256. if [ -n "${site_includes}" ]; then
  2257.   for arg in ${site_includes}
  2258.   do
  2259.     C_SWITCH_SITE="${C_SWITCH_SITE} -I${arg}"
  2260.     CPP="${CPP} -I${arg}"
  2261.   done
  2262. fi
  2263.  
  2264. # Avoid forcing the search of /usr/include before fixed include files.
  2265. if [ "$C_SWITCH_X_SITE" = "-I/usr/include" ]; then
  2266.    C_SWITCH_X_SITE=" "
  2267. fi
  2268.  
  2269. # Need for check for audio/Xtutil.h.
  2270. CPP="${CPP} ${C_SWITCH_X_SITE}"
  2271.  
  2272. case "${window_system}" in
  2273.   x11 )
  2274.     HAVE_X_WINDOWS=yes
  2275.     echo "  Using X11."
  2276.   ;;
  2277.   none )
  2278.     HAVE_X_WINDOWS=no
  2279.     echo "  Using no window system."
  2280.   ;;
  2281. esac
  2282.  
  2283. #### Extract some information from the operating system and machine files.
  2284.  
  2285. echo "examining the machine- and system-dependent files to find out"
  2286. echo " - which libraries the lib-src programs will want, and"
  2287. echo " - whether the GNU malloc routines are usable."
  2288.  
  2289. ### First figure out CFLAGS (which we use for running the compiler here)
  2290. ### and REAL_CFLAGS (which we use for real compilation).
  2291. ### The two are the same except on a few systems, where they are made
  2292. ### different to work around various lossages.  For example,
  2293. ### GCC 2.5 on Linux needs them to be different because it treats -g
  2294. ### as implying static linking.
  2295.  
  2296. ### If the CFLAGS env var is specified, we use that value
  2297. ### instead of the default.
  2298.  
  2299. ### It's not important that this name contain the PID; you can't run
  2300. ### two configures in the same directory and have anything work
  2301. ### anyway.
  2302. tempcname="conftest.c"
  2303.  
  2304. echo '
  2305. #define THIS_IS_YMAKEFILE
  2306. #include "'${srcdir}'/src/'${opsysfile}'"
  2307. #include "'${srcdir}'/src/'${machfile}'"
  2308. #ifndef LIBS_MACHINE
  2309. #define LIBS_MACHINE
  2310. #endif
  2311. #ifndef LIBS_SYSTEM
  2312. #define LIBS_SYSTEM
  2313. #endif
  2314. #ifndef C_SWITCH_SYSTEM
  2315. #define C_SWITCH_SYSTEM
  2316. #endif
  2317. #ifndef C_SWITCH_X_SYSTEM
  2318. #define C_SWITCH_X_SYSTEM
  2319. #endif
  2320. #ifndef C_SWITCH_MACHINE
  2321. #define C_SWITCH_MACHINE
  2322. #endif
  2323. #ifndef LD_SWITCH_X_SYSTEM
  2324. #define LD_SWITCH_X_SYSTEM
  2325. #endif
  2326. #ifndef LIB_STANDARD
  2327. #define LIB_STANDARD
  2328. #endif
  2329. configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM LIB_STANDARD
  2330. configure___ c_switch_system=C_SWITCH_SYSTEM
  2331. configure___ c_switch_x_system=C_SWITCH_X_SYSTEM
  2332. configure___ ld_switch_x_system=LD_SWITCH_X_SYSTEM
  2333. configure___ c_switch_machine=C_SWITCH_MACHINE
  2334.  
  2335. #ifndef LIB_X11_LIB
  2336. #define LIB_X11_LIB -lX11
  2337. #endif
  2338.  
  2339. #ifndef LIBX11_MACHINE
  2340. #define LIBX11_MACHINE
  2341. #endif
  2342.  
  2343. #ifndef LIBX11_SYSTEM
  2344. #define LIBX11_SYSTEM
  2345. #endif
  2346. configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
  2347.  
  2348. #ifdef UNEXEC
  2349. configure___ unexec=UNEXEC
  2350. #else
  2351. configure___ unexec=unexec.o
  2352. #endif
  2353.  
  2354. #ifdef SYSTEM_MALLOC
  2355. configure___ system_malloc=yes
  2356. #else
  2357. configure___ system_malloc=no
  2358. #endif
  2359.  
  2360. #ifndef C_DEBUG_SWITCH
  2361. #define C_DEBUG_SWITCH -g
  2362. #endif
  2363.  
  2364. #ifndef C_OPTIMIZE_SWITCH
  2365. #define C_OPTIMIZE_SWITCH -O
  2366. #endif
  2367.  
  2368. #ifdef THIS_IS_CONFIGURE
  2369.  
  2370. /* Get the CFLAGS for tests in configure.  */
  2371. #ifdef __GNUC__
  2372. configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
  2373. #else
  2374. configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
  2375. #endif
  2376.  
  2377. #else /* not THIS_IS_CONFIGURE */
  2378.  
  2379. /* Get the CFLAGS for real compilation.  */
  2380. #ifdef __GNUC__
  2381. configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
  2382. #else
  2383. configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
  2384. #endif
  2385.  
  2386. #endif /* not THIS_IS_CONFIGURE */
  2387. ' > ${tempcname}
  2388. # The value of CPP is a quoted variable reference, so we need to do this
  2389. # to get its actual value...
  2390. CPP=`eval "echo $CPP"`
  2391. eval `${CPP} -Isrc ${tempcname} \
  2392.        | grep 'configure___' \
  2393.        | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'`
  2394. if [ "x$CFLAGS" = x ]; then
  2395.   eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
  2396.      | grep 'configure___' \
  2397.      | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'`
  2398. else
  2399.   REAL_CFLAGS="$CFLAGS"
  2400. fi
  2401. rm ${tempcname}
  2402.  
  2403. # override CFLAGS if user wishes
  2404. if [ "${cflags}" != "NO_CFLAGS_DEFINED" ]; then
  2405.   REAL_CFLAGS=${cflags}
  2406. fi
  2407.  
  2408. ### Compute the unexec source name from the object name.
  2409. UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
  2410.  
  2411. # Do the opsystem or machine files prohibit the use of the GNU malloc?
  2412. # Assume not, until told otherwise.
  2413. GNU_MALLOC=yes
  2414. if [ "${system_malloc}" = "yes" ]; then
  2415.   GNU_MALLOC=no
  2416.   GNU_MALLOC_reason="
  2417.   (The GNU allocators don't work with this system configuration.)"
  2418. fi
  2419.  
  2420. LISP_FLOAT_TYPE=yes
  2421.  
  2422.  
  2423. #### Add the libraries to LIBS and check for some functions.
  2424.  
  2425. ]
  2426. DEFS="${C_SWITCH_SITE} $c_switch_system $c_switch_machine $c_switch_x_system $DEFS"
  2427. LIBS="${LD_SWITCH_SITE} $ld_switch_x_system $libsrc_libs"
  2428.  
  2429. dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
  2430. dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
  2431. AC_HAVE_LIBRARY(-ldnet)
  2432. dnl This causes -lresolv to get used in subsequent tests,
  2433. dnl which causes failures on some systems such as HPUX 9.
  2434. dnl AC_HAVE_LIBRARY(-lresolv)
  2435.  
  2436. AC_HAVE_LIBRARY(-lXbsd, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
  2437.  
  2438. echo checking for XFree86
  2439. if test -d /usr/X386/include; then
  2440.   HAVE_XFREE386=yes
  2441.   test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include"
  2442. elif test -d /usr/X11R6/include; then
  2443.   HAVE_XFREE386=yes
  2444.   test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X11R6/include"
  2445. fi
  2446.  
  2447. if test "${HAVE_X_WINDOWS}" = "yes"; then
  2448.   DEFS="$C_SWITCH_X_SITE $DEFS"
  2449.   LIBS="$LD_SWITCH_X_SITE $LIBS $LIBX"
  2450. fi
  2451.  
  2452. #
  2453. # make sure we can find libX11.*
  2454. #
  2455. if test "${window_system}" != "none" ; then
  2456.   internal_xlibs_found='no'
  2457.   AC_HAVE_LIBRARY(-lX11, internal_xlibs_found='yes')
  2458.   if test "${internal_xlibs_found}" = "no" ; then
  2459.     echo "Unable to find X11 libraries." >&2
  2460.     exit 1
  2461.   fi
  2462. fi
  2463.  
  2464. #
  2465. # make sure we can find Intrinsic.h
  2466. #
  2467. if test "${window_system}" != "none" ; then
  2468.   internal_xincludes_found='no'
  2469.   for arg in ${DEFS} /usr/include
  2470.   do
  2471.     if test -f `echo "${arg}/X11/Intrinsic.h" | sed 's/^\-I//'` ; then
  2472.       internal_xincludes_found='yes'
  2473.     fi
  2474.   done
  2475.   if test "${internal_xincludes_found}" = "no" ; then
  2476.     echo "Unable to find X11 header files." >&2
  2477.     exit 1
  2478.   fi
  2479. fi
  2480.  
  2481. #
  2482. # See if we can find Xauth.
  2483. #
  2484. with_xauth='no'
  2485. internal_xauth_lib_found='no'
  2486. AC_HAVE_LIBRARY(-lXau, internal_xauth_lib_found='yes')
  2487. if test "${internal_xauth_lib_found}" = "yes" ; then
  2488.   internal_xauth_includes_found='no'
  2489.   for arg in ${DEFS} /usr/include
  2490.   do
  2491.     if test -f `echo "${arg}/X11/Xauth.h" | sed 's/^\-I//'` ; then
  2492.       internal_xauth_includes_found='yes'
  2493.     fi
  2494.   done
  2495.   if test "${internal_xauth_includes_found}" = "yes" ; then
  2496.     AC_VERBOSE(defining HAVE_XAUTH)
  2497.     with_xauth='yes'
  2498.   fi
  2499. fi
  2500.  
  2501. AC_FIND_X_VERSION
  2502.  
  2503. #
  2504. # if Energize specified, make sure we can find its need libraries/headers
  2505. #
  2506. if test "${with_energize}" = "yes" ; then
  2507.   AC_HAVE_LIBRARY(-lenergize, energize_version='3.X')
  2508.   if test "${energize_version}" = "no" ; then
  2509.     AC_HAVE_LIBRARY(-lconn, energize_version='2.X')
  2510.     if test "${energize_version}" = "no" ; then
  2511.       echo "Unable to find Energize library." >&2
  2512.       exit 1
  2513.     fi
  2514.   fi
  2515.  
  2516.   internal_eincludes_found='no'
  2517.   for arg in ${DEFS} /usr/include
  2518.   do
  2519.     if test -f `echo "${arg}/editorconn.h" | sed 's/^\-I//'` ; then
  2520.       internal_eincludes_found='yes'
  2521.     fi
  2522.   done
  2523.   if test "${internal_eincludes_found}" = "no" ; then
  2524.     echo "Unable to find Energize editorconn.h header file." >&2
  2525.     exit 1
  2526.   fi
  2527. fi
  2528.  
  2529. # logb and frexp are found in -lm on most systems.
  2530. AC_HAVE_LIBRARY(-lm)
  2531.  
  2532. # see if XPM is hanging around somewhere
  2533. if test "${window_system}" != "none" ; then
  2534.   if test "${with_xpm}" != "no" ; then
  2535.     if test "${with_xpm}" != "yes" ; then
  2536.       AC_HAVE_LIBRARY(-lXpm, with_xpm="yes")
  2537.       if test "${with_xpm}" = "yes" ; then
  2538.         AC_VERBOSE(defining HAVE_XPM)
  2539.       fi
  2540.     fi
  2541.   fi
  2542. fi
  2543.  
  2544. # see if COMPFACE is hanging around somewhere
  2545. if test "${window_system}" != "none" ; then
  2546.   if test "${with_xface}" != "no" ; then
  2547.     if test "${with_xface}" != "yes" ; then
  2548.       AC_HEADER_CHECK(compface.h, compface_incl="yes", with_xface="no")
  2549.       if test "${compface_incl}" = "yes" ; then
  2550.         AC_HAVE_LIBRARY(-lcompface, with_xface="yes")
  2551.         if test "${with_xface}" = "yes" ; then
  2552.           AC_VERBOSE(defining HAVE_XFACE)
  2553.         fi
  2554.       fi
  2555.     fi
  2556.   fi
  2557. fi
  2558.  
  2559. # #### add autodetect for GIF, JPEG, and PNG here
  2560.  
  2561. # We use Lucid toolkit defaults for the menubars and scrollbars, but
  2562. # if Motif is available we use it for the dialog boxes.
  2563. if test "${window_system}" != "none" ; then
  2564.   if test "x${with_dialogs}" = "x" ; then
  2565.       # We can't use ac_have_library because it simply appends -lXm to the
  2566.       # end of the link line which is insufficient since -lXm will generate
  2567.       # dependencies on -lXt
  2568. # begin expansion of ac_have_library
  2569. ac_save_LIBS="${LIBS}"
  2570. LIBS="${LIBS} -lXm -lXt ${LIBS}"
  2571. ac_have_lib=""
  2572. test -n "$silent" || echo "checking for -lXm"
  2573. cat > conftest.${ac_ext} <<EOF
  2574. #include "confdefs.h"
  2575.  
  2576. int main() { return 0; }
  2577. int t() { main();; return 0; }
  2578. EOF
  2579. if eval $ac_compile; then
  2580.   rm -rf conftest*
  2581.   ac_have_lib="1"
  2582.  
  2583. fi
  2584. rm -f conftest*
  2585. LIBS="${ac_save_LIBS}"
  2586. if test -n "${ac_have_lib}"; then
  2587.    :; with_dialogs="motif"
  2588. else
  2589.    :; 
  2590. fi
  2591. # end expansion of ac_have_library
  2592.     if test "${with_dialogs}" = "motif" ; then
  2593.       AC_VERBOSE(Found Motif)
  2594.     fi
  2595.   fi
  2596. fi
  2597.  
  2598. [
  2599. if [ "${with_menubars}" = "motif" ] || [ "${with_scrollbars}" = "motif" ] \
  2600.    || [ "${with_dialogs}" = "motif" ]; then
  2601.   with_motif='yes'
  2602. fi
  2603.  
  2604. # Finish ensuring that we have values for the various toolkit items.
  2605. if [ "x${with_menubars}" = "x" ] || [ "${with_menubars}" = "athena" ]; then
  2606.   with_menubars='lucid'
  2607. fi
  2608. if [ "x${with_scrollbars}" = "x" ]; then
  2609.     with_scrollbars='lucid'
  2610. fi
  2611. if [ "x${with_dialogs}" = "x" ] || [ "${with_dialogs}" = "lucid" ]; then
  2612.     with_dialogs='athena'
  2613. fi
  2614. ]
  2615.  
  2616. # If netdb.h doesn't declare h_errno, we must declare it by hand.
  2617. AC_COMPILE_CHECK(declaration of h_errno in netdb.h,
  2618.                [#include <netdb.h>],
  2619.                [
  2620. int
  2621. foo ()
  2622. {
  2623.   return h_errno;
  2624. }
  2625. ],
  2626.                AC_DEFINE(HAVE_H_ERRNO))
  2627.  
  2628. # This does all sorts of magic to make sure alloca() works OK.
  2629. # It might even add some junk to the top of <config.h>.
  2630. # (I don't understand what goes on here, but it seems to work.)
  2631. AC_ALLOCA
  2632.  
  2633. # Check whether vfork exists and works correctly. (This does more
  2634. # than just check for its existence.) If so, it defines HAVE_VFORK_H.
  2635. # If not, it defines vfork to be fork.
  2636. AC_VFORK
  2637.  
  2638. # Check whether mmap exists and works correctly. (This does more
  2639. # than just check for its existence.) If so, it defines HAVE_MMAP.
  2640. # Actually, this seems to rule out some cases where mmap() can
  2641. # work fine for our purposes (e.g. HPUX).  We get a big win out
  2642. # of using mmap(), so let's go back to the old way.
  2643. dnl AC_MMAP
  2644.  
  2645. # Check whether strcoll exists and works correctly. (This does more
  2646. # than just check for its existence.) If so, it defines HAVE_STRCOLL.
  2647. AC_STRCOLL
  2648.  
  2649. AC_SIZEOF_TYPE(short)
  2650. AC_SIZEOF_TYPE(int)
  2651. AC_SIZEOF_TYPE(long)
  2652.  
  2653. AC_HAVE_FUNCS(cbrt closedir dup2 fpathconf frexp gethostname getpagesize gettimeofday getwd acosh asinh atanh logb matherr mkdir perror random lrand48 realpath rename res_init rint rmdir select setitimer setpgid setsid sigblock sighold sigprocmask strerror utimes waitpid)
  2654.  
  2655. # Check for mmap.
  2656. found_mmap=true
  2657. AC_FUNC_CHECK(mmap, , found_mmap=)
  2658. if test -n "$found_mmap"; then
  2659.   AC_DEFINE(HAVE_MMAP)
  2660. fi
  2661.  
  2662. [
  2663. # rel_alloc requires either GNU malloc or system malloc with mmap
  2664. if [ "${GNU_MALLOC}" != "yes" ]; then
  2665.   if [ "${found_mmap}" != "true" ]; then
  2666.     rel_alloc=no
  2667.   fi
  2668. fi
  2669.  
  2670. # We only turn rel_alloc on by default if mmap is available.
  2671. if [ "${rel_alloc}" = "default" ]; then
  2672.   if [ "${found_mmap}" = "true" ]; then
  2673.     rel_alloc=yes
  2674.   fi
  2675. fi
  2676. ]
  2677.  
  2678.  
  2679. # Check for Internet sockets.
  2680.  
  2681. ok_so_far=true
  2682. AC_FUNC_CHECK(socket, , ok_so_far=)
  2683. if test -n "$ok_so_far"; then
  2684.   AC_HEADER_CHECK(netinet/in.h, , ok_so_far=)
  2685. fi
  2686. if test -n "$ok_so_far"; then
  2687.   AC_HEADER_CHECK(arpa/inet.h, , ok_so_far=)
  2688. fi
  2689. if test -n "$ok_so_far"; then
  2690.   AC_DEFINE(HAVE_SOCKETS)
  2691. fi
  2692.  
  2693. # Check for SYS V IPC. (Inferior to sockets.)
  2694.  
  2695. if test -z "$ok_so_far"; then
  2696.   ok_so_far=true
  2697.   AC_FUNC_CHECK(msgget, , ok_so_far=)
  2698.   if test -n "$ok_so_far"; then
  2699.     AC_HEADER_CHECK(sys/ipc.h, , ok_so_far=)
  2700.   fi
  2701.   if test -n "$ok_so_far"; then
  2702.     AC_HEADER_CHECK(sys/msg.h, , ok_so_far=)
  2703.   fi
  2704.   if test -n "$ok_so_far"; then
  2705.     AC_DEFINE(HAVE_SYSVIPC)
  2706.   fi
  2707. fi
  2708.  
  2709. # Check for directory variants
  2710.  
  2711. sysv_system_dir=
  2712. nonsystem_dir_library=
  2713. AC_HEADER_CHECK(dirent.h, sysv_system_dir=yes, )
  2714. if test -z "$sysv_system_dir" ; then
  2715.   AC_HEADER_CHECK(sys/dir.h, , nonsystem_dir_library=yes)
  2716. fi
  2717. if test -n "$sysv_system_dir" ; then
  2718.   AC_DEFINE(SYSV_SYSTEM_DIR)
  2719. elif test -n "$nonsystem_dir_library" ; then
  2720.   AC_DEFINE(NONSYSTEM_DIR_LIBRARY)
  2721. fi
  2722.  
  2723. # Check for terminal I/O variants
  2724.  
  2725. echo "checking how to do terminal I/O"
  2726.  
  2727. have_termios=
  2728. have_termio=
  2729. AC_HEADER_CHECK(termios.h, have_termios=yes, )
  2730. # TERMIOS systems may have termio.h, but not vice-versa, I think.
  2731. if test -z "$have_termios" ; then
  2732.   AC_HEADER_CHECK(termio.h, have_termio=yes, )
  2733. fi
  2734. if test -n "$have_termios" ; then
  2735.   AC_DEFINE(HAVE_TERMIOS)
  2736. elif test -n "$have_termio" ; then
  2737.   AC_DEFINE(HAVE_TERMIO)
  2738. fi
  2739.  
  2740. # Check for nlist.h
  2741. AC_HEADER_CHECK(nlist.h, AC_DEFINE(NLIST_STRUCT), )
  2742.  
  2743. # Set up the CFLAGS for real compilation, so we can substitute it.
  2744. CFLAGS="$REAL_CFLAGS"
  2745.  
  2746. [
  2747. #### Find out which version of XEmacs this is.
  2748. version=`grep 'defconst[     ]*emacs-version' ${srcdir}/lisp/version.el \
  2749.      | sed -ne 's/^(defconst emacs-version "\([0-9][0-9]\.[0-9]*\).*/\1/p'`
  2750. beta=`grep '" XEmacs Lucid' ${srcdir}/lisp/version.el \
  2751.       | sed -ne 's/^.*" XEmacs Lucid (beta\([^)]*\)).*/\1/p'`
  2752. alpha=`grep '" XEmacs Lucid' ${srcdir}/lisp/version.el \
  2753.        | sed -ne 's/^.*" XEmacs Lucid (alpha\([^)]*\)).*/\1/p'`
  2754. if [ "X$beta" != "X" ]; then
  2755.   version=${version}-b${beta}
  2756. fi
  2757. if [ "X$alpha" != "X" ]; then
  2758.   version=${version}-a${alpha}
  2759. fi
  2760. if [ x"${version}" = x ]; then
  2761.   echo "${progname}: can't find current emacs version in
  2762.     \`${srcdir}/lisp/version.el'." >&2
  2763.   exit 1
  2764. fi
  2765.  
  2766. if [ -f /usr/lpp/X11/bin/smt.exp ]; then
  2767.   ]
  2768.   AC_DEFINE(AIX_SMT_EXP, /usr/lpp/X11/bin/smt.exp)
  2769.   [
  2770. elif [ -f /usr/bin/X11/smt.exp ]; then
  2771.   ]
  2772.   AC_DEFINE(AIX_SMT_EXP, /usr/bin/X11/smt.exp)
  2773.   [
  2774. fi
  2775.  
  2776. # the following needs to be fixed for SGI.
  2777. if [ -z "${native_sound_lib}" ]; then
  2778.   case "${canonical}" in
  2779.     *-sun-sunos* | *-sun-bsd* )
  2780.     native_sound_lib=/usr/demo/SOUND/libaudio.a ;;
  2781.     *-sun-solaris* | *-sun-sunos5* )
  2782.     native_sound_lib=/usr/demo/SOUND/lib/libaudio.a ;;
  2783.     *-sgi-* )
  2784.     native_sound_lib=-laudio ;;
  2785.     hppa*-hp-hpux* )
  2786.     native_sound_lib=-lAlib ;;
  2787.   esac
  2788. fi
  2789.  
  2790. if [ "${with_sound}" != "native" ] && [ "${with_sound}" != "nas" ] && [ "${with_sound}" != "both" ] && [ "${with_sound}" != "no" ] ; then
  2791.   case "${canonical}" in
  2792.     *-sun-sunos* | *-sun-bsd* )
  2793.       if [ -d /usr/demo/SOUND/multimedia ]; then
  2794.         with_sound="native"
  2795.       fi
  2796.     ;;
  2797.     *-sun-solaris* | *-sun-sunos5* )
  2798.       if [ -d /usr/demo/SOUND/include/multimedia ]; then
  2799.         with_sound="native"
  2800.       fi
  2801.     ;;
  2802.     *-sgi-* )
  2803.       ] AC_HAVE_LIBRARY(-laudio, with_sound="native") [
  2804.     ;;
  2805.     hppa*-hp-hpux* )
  2806.       ] AC_HAVE_LIBRARY(-lAlib, with_sound="native") [
  2807.     ;;
  2808.   esac
  2809. fi
  2810.  
  2811. #### If the nas library doesn't contain the error jump point, then
  2812. #### we force safer behaviour.
  2813.  
  2814. if [ "${with_sound}" = "nas" ] || [ "${with_sound}" = "both" ] ;    then
  2815.     ] AC_HEADER_EGREP(AuXtErrorJump,audio/Xtutil.h, , old_nas=true) [
  2816. fi
  2817.  
  2818. if [ "${with_tooltalk}" = "yes" ]; then
  2819.   for arg in ${DEFS} "-I/usr/include" "-I/usr/openwin/include"
  2820.   do
  2821.     if [ -f `echo "${arg}/desktop/tt_c.h" | sed 's/^\-I//'` ]; then
  2822.       C_SWITCH_X_SITE="${C_SWITCH_X_SITE} ${arg}/desktop"
  2823.     fi
  2824.   done
  2825.  
  2826.   for arg in ${LIBS} "-L/usr/lib" "-L/usr/openwin/lib"
  2827.   do
  2828.     case "${arg}" in
  2829.     -L*) if [ -f `echo "${arg}/libtt.a" | sed 's/^\-L//'` ]; then
  2830.          dash_r=''
  2831.          if [ -n "${add_runtime_flag}" ]; then
  2832.              dash_r=`echo ${arg} | sed "s/^-L/-R${dash_r_space}/"`
  2833.          fi
  2834.          LD_SWITCH_X_SITE="${LD_SWITCH_X_SITE} ${arg} ${dash_r}"
  2835.          fi
  2836.          ;;
  2837.     esac
  2838.   done
  2839. fi
  2840.  
  2841. #### Specify what sort of things we'll be editing into Makefile and config.h.
  2842. ### Use configuration here uncanonicalized to avoid exceeding size limits.
  2843. ]
  2844. AC_SUBST(version)
  2845. AC_SUBST(configuration)
  2846. AC_SUBST(srcdir)
  2847. AC_SUBST(prefix)
  2848. AC_SUBST(exec_prefix)
  2849. AC_SUBST(bindir)
  2850. AC_SUBST(datadir)
  2851. AC_SUBST(statedir)
  2852. AC_SUBST(libdir)
  2853. AC_SUBST(mandir)
  2854. AC_SUBST(infodir)
  2855. AC_SUBST(lispdir)
  2856. AC_SUBST(sitelispdir)
  2857. AC_SUBST(etcdir)
  2858. AC_SUBST(lockdir)
  2859. AC_SUBST(archlibdir)
  2860. AC_SUBST(docdir)
  2861. AC_SUBST(c_switch_system)
  2862. AC_SUBST(c_switch_machine)
  2863. AC_SUBST(libsrc_libs)
  2864. AC_SUBST(LD_SWITCH_X_SITE)
  2865. AC_SUBST(LD_SWITCH_X_SITE_AUX)
  2866. AC_SUBST(C_SWITCH_X_SITE)
  2867. AC_SUBST(LD_SWITCH_SITE)
  2868. AC_SUBST(C_SWITCH_SITE)
  2869. AC_SUBST(CFLAGS)
  2870. AC_SUBST(native_sound_lib)
  2871. AC_SUBST(machfile)
  2872. AC_SUBST(opsysfile)
  2873. AC_SUBST(dynodump_arch)
  2874.  
  2875. AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,    "\"${configuration}\"")
  2876. AC_DEFINE_UNQUOTED(config_machfile,  "\"${machfile}\"")
  2877. AC_DEFINE_UNQUOTED(config_opsysfile, "\"${opsysfile}\"")
  2878. AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE})
  2879. AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX})
  2880. AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE,  ${C_SWITCH_X_SITE})
  2881. AC_DEFINE_UNQUOTED(LD_SWITCH_SITE,   ${LD_SWITCH_SITE})
  2882. AC_DEFINE_UNQUOTED(C_SWITCH_SITE,    ${C_SWITCH_SITE})
  2883. AC_DEFINE_UNQUOTED(UNEXEC_SRC,       ${UNEXEC_SRC})
  2884.  
  2885. [
  2886. if [ x"${puresize}" != x ] ; then
  2887.   ] AC_DEFINE_UNQUOTED(PURESIZE,    ${puresize}) [
  2888. fi
  2889. if [ "${HAVE_X_WINDOWS}" = "yes" ] ; then
  2890.   ] AC_DEFINE(HAVE_X_WINDOWS) [
  2891. fi
  2892. if [ "${HAVE_XFREE386}" = "yes" ] ; then
  2893.   ] AC_DEFINE(HAVE_XFREE386) [
  2894. fi
  2895. if [ "${GNU_MALLOC}" = "yes" ] ; then
  2896.   ] AC_DEFINE(GNU_MALLOC) [
  2897. fi
  2898. if [ "${rel_alloc}" = "yes" ] ; then
  2899.   ] AC_DEFINE(REL_ALLOC) [
  2900. fi
  2901. if [ "${LISP_FLOAT_TYPE}" = "yes" ] ; then
  2902.   ] AC_DEFINE(LISP_FLOAT_TYPE) [
  2903. fi
  2904. if [ "${with_motif}" = "yes" ] ; then
  2905.   ] AC_DEFINE(LWLIB_USES_MOTIF) [
  2906. fi
  2907. if [ "${with_menubars}" = "lucid" ] ; then
  2908.   ] AC_DEFINE(LWLIB_MENUBARS_LUCID) [
  2909. fi
  2910. if [ "${with_menubars}" = "motif" ]; then
  2911.   ] AC_DEFINE(LWLIB_MENUBARS_MOTIF) [
  2912. fi
  2913. if [ "${with_scrollbars}" = "lucid" ] ; then
  2914.   ] AC_DEFINE(LWLIB_SCROLLBARS_LUCID) [
  2915. fi
  2916. if [ "${with_scrollbars}" = "motif" ] ; then
  2917.   ] AC_DEFINE(LWLIB_SCROLLBARS_MOTIF) [
  2918. fi
  2919. if [ "${with_scrollbars}" = "athena" ] ; then
  2920.   ] AC_DEFINE(LWLIB_SCROLLBARS_ATHENA) [
  2921. fi
  2922. if [ "${with_dialogs}" = "motif" ] ; then
  2923.   ] AC_DEFINE(LWLIB_DIALOGS_MOTIF) [
  2924. fi
  2925. if [ "${with_dialogs}" = "athena" ] ; then
  2926.   ] AC_DEFINE(LWLIB_DIALOGS_ATHENA) [
  2927. fi
  2928. if [ "${with_tooltalk}" = "yes" ] ; then
  2929.   ] AC_DEFINE(TOOLTALK) [
  2930. fi
  2931. if [ "$with_i18n3" = "yes" ]; then
  2932.   ] AC_DEFINE(I18N3) [
  2933. fi
  2934. if [ "$with_mule" = "yes" ]; then
  2935.   ] AC_DEFINE(MULE) [
  2936. fi
  2937. if [ "${with_sparcworks}" = "yes" ] ; then
  2938.   ] AC_DEFINE(SUNPRO) [
  2939. fi
  2940. if [ "${usage_tracking}" = "yes" ] ; then
  2941.   ] AC_DEFINE(USAGE_TRACKING) [
  2942. fi
  2943. if [ "${with_energize}" = "yes" ] ; then
  2944.   ] AC_DEFINE(ENERGIZE) [
  2945.   if [ "${energize_version}" = "2.X" ] ; then
  2946.     ] AC_DEFINE(ENERGIZE_2) [
  2947.   elif [ "${energize_version}" = "3.X" ] ; then
  2948.     ] AC_DEFINE(ENERGIZE_3) [
  2949.   fi
  2950. fi
  2951. if [ "${need_dynodump}" = "yes" ] ; then
  2952.   ] AC_DEFINE(DYNODUMP) [
  2953. fi
  2954. if [ "${with_gcc}" = "yes" ] ; then
  2955.   ] AC_DEFINE(USE_GCC) [
  2956. fi
  2957. if [ "${with_lcc}" = "yes" ] ; then
  2958.   ] AC_DEFINE(USE_LCC) [
  2959. fi
  2960. if [ "${with_socks}" = "yes" ]; then
  2961.   ] AC_DEFINE(HAVE_SOCKS) [
  2962. fi
  2963. if [ "${with_xpm}" = "yes" ]; then
  2964.   ] AC_DEFINE(HAVE_XPM) [
  2965. fi
  2966. if [ "${with_xface}" = "yes" ]; then
  2967.   ] AC_DEFINE(HAVE_XFACE) [
  2968. fi
  2969. if [ "${with_gif}" = "yes" ]; then
  2970.   ] AC_DEFINE(HAVE_GIF) [
  2971. fi
  2972. if [ "${with_jpg}" = "yes" ]; then
  2973.   ] AC_DEFINE(HAVE_JPG) [
  2974. fi
  2975. if [ "${with_png}" = "yes" ]; then
  2976.   ] AC_DEFINE(HAVE_PNG) [
  2977. fi
  2978. if [ "${with_xauth}" = "yes" ]; then
  2979.   ] AC_DEFINE(HAVE_XAUTH) [
  2980. fi
  2981. if [ "${with_epoch}" = "yes" ]; then
  2982.   ] AC_DEFINE(EPOCH) [
  2983. fi
  2984. if [ "${dont_have_xmu}" != "yes" ]; then
  2985.   ] AC_DEFINE(HAVE_XMU) [
  2986. fi
  2987. if [ "${with_sound}" = "native" -o  "${with_sound}" = "both" ]; then
  2988.   ] AC_DEFINE(HAVE_NATIVE_SOUND) [
  2989. fi
  2990. if [ "${with_sound}" = "nas" -o  "${with_sound}" = "both" ]; then
  2991.   ] AC_DEFINE(HAVE_NAS_SOUND) [
  2992. fi
  2993. if [ "${old_nas}" = "true" ] ; then
  2994.   ] AC_DEFINE(NAS_NO_ERROR_JUMP) [
  2995. fi
  2996. if [ "${external_widget}" = "yes" ]; then
  2997.   ] AC_DEFINE(EXTERNAL_WIDGET) [
  2998. fi
  2999. if [ "${const_is_losing}" = "yes" ]; then
  3000.   ] AC_DEFINE(CONST_IS_LOSING) [
  3001. fi
  3002. if [ "${use_assertions}" = "yes" ]; then
  3003.   ] AC_DEFINE(USE_ASSERTIONS) [
  3004. fi
  3005. if [ "${error_check_extents}" = "yes" ]; then
  3006.   ] AC_DEFINE(ERROR_CHECK_EXTENTS) [
  3007. fi
  3008. if [ "${error_check_typecheck}" = "yes" ]; then
  3009.   ] AC_DEFINE(ERROR_CHECK_TYPECHECK) [
  3010. fi
  3011. if [ "${error_check_bufpos}" = "yes" ]; then
  3012.   ] AC_DEFINE(ERROR_CHECK_BUFPOS) [
  3013. fi
  3014. if [ "${error_check_gc}" = "yes" ]; then
  3015.   ] AC_DEFINE(ERROR_CHECK_GC) [
  3016. fi
  3017. if [ "${error_check_malloc}" = "yes" ]; then
  3018.   ] AC_DEFINE(ERROR_CHECK_MALLOC) [
  3019. fi
  3020. if [ "${debug}" = "yes" ]; then
  3021.   ] AC_DEFINE(DEBUG_XEMACS) [
  3022. fi
  3023. if [ "${quantify}" = "yes" ]; then
  3024.   ] AC_DEFINE(QUANTIFY) [
  3025. fi
  3026.  
  3027. # ====================== Developer's configuration =======================
  3028.  
  3029. # The following assignments make sense if you're running XEmacs on a single
  3030. # machine, one version at a time, and you want changes to the lisp and etc
  3031. # directories in the source tree to show up immediately in your working
  3032. # environment.  It saves a great deal of disk space by not duplicating the
  3033. # lisp and etc directories.
  3034.  
  3035. if [ "$run_in_place" = "yes" ]; then
  3036.    prefix='${srcdir}'
  3037.    exec_prefix='${srcdir}'
  3038.    bindir='${exec_prefix}/bin/${configuration}'
  3039.    lispdir='${srcdir}/lisp'
  3040.    sitelispdir='${lispdir}/site-lisp'
  3041.    etcdir='${srcdir}/etc'
  3042.    lockdir='${srcdir}/lock'
  3043.    archlibdir='${srcdir}/lib-src/${configuration}'
  3044.    infodir='${srcdir}/info'
  3045. fi
  3046. #elif [ "$single_tree" = "1" ]; then
  3047. #   if [ "$exec_prefix_specified" = "" ]; then
  3048. #      exec_prefix='${prefix}'
  3049. #   fi
  3050. #   if [ "$bindir_specified" = "" ]; then
  3051. #      bindir='${exec_prefix}/bin/${configuration}'
  3052. #   fi
  3053. #   if [ "$datadir_specified" = "" ]; then
  3054. #      datadir='${prefix}/common'
  3055. #   fi
  3056. #   if [ "$statedir_specified" = "" ]; then
  3057. #      statedir='${prefix}/common'
  3058. #   fi
  3059. #   if [ "$libdir_specified" = "" ]; then
  3060. #      libdir='${bindir}'
  3061. #   fi
  3062. #   if [ "$lispdir_specified" = "" ]; then
  3063. #      lispdir='${prefix}/common/lisp'
  3064. #   fi
  3065. #   if [ "$locallisppath_specified" = "" ]; then
  3066. #      locallisppath='${prefix}/common/site-lisp'
  3067. #   fi
  3068. #   if [ "$lockdir_specified" = "" ]; then
  3069. #      lockdir='${prefix}/common/lock'
  3070. #   fi
  3071. #   if [ "$archlibdir_specified" = "" ]; then
  3072. #      archlibdir='${libdir}/etc'
  3073. #   fi
  3074. #   if [ "$etcdir_specified" = "" ]; then
  3075. #      etcdir='${prefix}/common/data'
  3076. #   fi
  3077. #   if [ "$docdir_specified" = "" ]; then
  3078. #      docdir='${prefix}/common/data'
  3079. #   fi
  3080. #fi
  3081.  
  3082. #### Report on what we decided to do.
  3083. echo "
  3084.  
  3085. Configured for \`${canonical}'.
  3086.  
  3087.   Where should the build process find the source code?    ${srcdir}
  3088.   What installation prefix should install use?          ${prefix}
  3089.   What operating system and machine description files should XEmacs use?
  3090.         \`${opsysfile}' and \`${machfile}'
  3091.   What compiler should XEmacs be built with?              ${CC} ${CFLAGS}
  3092.   Should XEmacs use the GNU version of malloc?            ${GNU_MALLOC}${GNU_MALLOC_reason}
  3093.   Should XEmacs use the relocating allocator for buffers? ${rel_alloc}
  3094.   What window system should XEmacs use?                   ${window_system}${x_includes+
  3095.   Where do we find X Windows header files?                }${x_includes}${x_libraries+
  3096.   Where do we find X Windows libraries?                   }${x_libraries}"
  3097.  
  3098. if [ -n "$site_includes" ]; then
  3099.   echo "  Additional header files:                                ${site_includes}"
  3100. fi
  3101.  
  3102. if [ -n "$site_libraries" ] && [ -n "$site_runtime_libraries" ]; then
  3103.   echo "  Additional libraries:                                   ${site_libraries} ${site_runtime_libraries}"
  3104. elif [ -n "$site_libraries" ]; then
  3105.   echo "  Additional libraries:                                   ${site_libraries}"
  3106. elif [ -n "$site_runtime_libraries" ]; then
  3107.   echo "  Additional libraries:                                   ${site_runtime_libraries}"
  3108. fi
  3109.  
  3110. if [ "$with_socks" = "yes" ]; then
  3111.   echo "  Compiling in support for SOCKS."
  3112. fi
  3113. if [ "$with_xpm" = "yes" ]; then
  3114.   echo "  Compiling in support for XPM."
  3115. fi
  3116. if [ "$with_xface" = "yes" ]; then
  3117.   echo "  Compiling in support for X-Face headers."
  3118. fi
  3119. if [ "$with_gif" = "yes" ]; then
  3120.   echo "  Compiling in support for GIF image conversion."
  3121. fi
  3122. if [ "$with_jpeg" = "yes" ]; then
  3123.   echo "  Compiling in support for JPEG image conversion."
  3124. fi
  3125. if [ "$with_png" = "yes" ]; then
  3126.   echo "  Compiling in support for PNG image conversion."
  3127. fi
  3128. if [ "$with_epoch" = "yes" ]; then
  3129.   echo "  Compiling in extra Epoch compatibility."
  3130. fi
  3131. if [ "$with_sound" = "nas" ]; then
  3132.   echo "  Compiling in network sound support."
  3133. fi
  3134. if [ "$with_sound" = "native" ]; then
  3135.   echo "  Compiling in native sound support."
  3136. fi
  3137. if [ "$with_sound" = "both" ]; then
  3138.   echo "  Compiling in both network and native sound support."
  3139. fi
  3140. if [ "$old_nas" = true ]; then
  3141.   echo "        nas library lacks error trapping, will play synchronously"
  3142. fi
  3143. if [ "$with_tooltalk" = "yes" ]; then
  3144.   echo "  Compiling in support for ToolTalk."
  3145. fi
  3146. if [ "$with_i18n3" = "yes" ]; then
  3147.   echo "  Compiling in I18N support, level 3 (not fully supported)."
  3148. fi
  3149. if [ "$with_mule" = "yes" ]; then
  3150.   echo "  Compiling in Mule support.  This doesn't work yet."
  3151.   echo "    Let me say that again: Mule support DOES NOT work currently."
  3152.   echo "    It doesn't even compile yet."
  3153. fi
  3154. if [ "$with_sparcworks" = "yes" ]; then
  3155.   echo "  Compiling in support for SparcWorks."
  3156. fi
  3157. if [ "$with_energize" = "yes" ]; then
  3158.   echo "  Compiling in support for Lucid Energize."
  3159. fi
  3160. if [ "$with_menubars" = "lucid" ]; then
  3161.   echo "  Using the Lucid menubar."
  3162. fi
  3163. if [ "$with_menubars" = "motif" ]; then
  3164.   echo "  Using the Motif menubar."
  3165.   echo " *WARNING*  The Motif menubar is currently buggy.  We recommend"
  3166.   echo "            that you use the Lucid menubar instead.  Re-run"
  3167.   echo "            configure with --with-menubars='lucid'."
  3168. fi
  3169. if [ "$with_scrollbars" = "lucid" ]; then
  3170.   echo "  Using the Lucid scrollbar."
  3171. fi
  3172. if [ "$with_scrollbars" = "motif" ]; then
  3173.   echo "  Using the Motif scrollbar."
  3174. fi
  3175. if [ "$with_scrollbars" = "athena" ]; then
  3176.   echo "  Using the Athena scrollbar."
  3177. fi
  3178. if [ "$with_dialogs" = "motif" ]; then
  3179.   echo "  Using the Motif dialog boxes."
  3180. fi
  3181. if [ "$with_dialogs" = "athena" ]; then
  3182.   echo "  Using the Athena dialog boxes."
  3183. fi
  3184. if [ "$usage_tracking" = "yes" ]; then
  3185.   echo "  Compiling with usage tracking active."
  3186. fi
  3187. echo "
  3188. "
  3189.  
  3190. # This has to be called in order for this variable to get into config.status
  3191. ] AC_SUBST(internal_makefile_list) [
  3192. # Remove any trailing slashes in these variables.
  3193. test -n "${prefix}" &&
  3194.   prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
  3195. test -n "${exec_prefix}" &&
  3196.   exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
  3197. ]
  3198. AC_OUTPUT($internal_makefile_list) [
  3199. # Build src/Makefile from ${srcdir}/src/Makefile.in, lwlib/Makefile
  3200. # from ${srcdir}/lwlib/Makefile.in, lib-src/Makefile from
  3201. # ${srcdir}/lib-src/Makefile.in and dynodmp/Makefile from
  3202. # ${srcdir}/dynodump/Makefile.in.  This must be done after src/config.h
  3203. # is built, since we rely on that file.  Only do the build if
  3204. # "config.status" is present, since it's non-presence indicates
  3205. # an error occured.
  3206. status=$?
  3207. if [ ! -f ./config.status ]; then
  3208.    exit $status
  3209. fi
  3210. topsrcdir=${srcdir}
  3211.   # We discard all lines in Makefile.in that start with `# Generated' or /**/#
  3212.   # because some cpps get confused by them.
  3213.   # Really we should preserve them somehow into Makefile,
  3214.   # but that is beyond my level of shell programming.
  3215. makefile_command='echo "creating src/Makefile";
  3216.   topsrcdir='"${topsrcdir}"';
  3217. ( cd ./src;
  3218.   rm -f junk.c;
  3219.   sed -e '\''s/^# Generated.*//'\'' -e '\''s%/\*\*/#.*%%'\'' < Makefile.in > junk.c;
  3220.   eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
  3221.   < junk.cpp                            '\
  3222. '    sed -e '\''s/^#.*//'\''                    '\
  3223. '    -e '\''s/^[ \f\t][ \f\t]*$//'\''            '\
  3224. '    -e '\''s/^ /    /'\''                     '\
  3225. '    | sed -n -e '\''/^..*$/p'\''                '\
  3226. '    > Makefile.new;
  3227.     chmod 444 Makefile.new;
  3228.     mv -f Makefile.new Makefile;
  3229.     rm -f junk.c junk.cpp;
  3230. )'
  3231. eval `echo $makefile_command`
  3232. lwlib_makefile_command='echo "creating lwlib/Makefile";
  3233.   topsrcdir='"${topsrcdir}"';
  3234. ( cd ./lwlib;
  3235.   rm -f junk.c;
  3236.   sed -e '\''s/^# Generated.*//'\'' -e '\''s%/\*\*/#.*%%'\'' < Makefile.in > junk.c;
  3237.   eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
  3238.   < junk.cpp                            '\
  3239. '    sed -e '\''s/^#.*//'\''                    '\
  3240. '    -e '\''s/^[ \f\t][ \f\t]*$//'\''            '\
  3241. '    -e '\''s/^ /    /'\''                     '\
  3242. '    | sed -n -e '\''/^..*$/p'\''                '\
  3243. '    > Makefile.new;
  3244.     chmod 444 Makefile.new;
  3245.     mv -f Makefile.new Makefile;
  3246.     rm -f junk.c junk.cpp;
  3247. )'
  3248. eval `echo $lwlib_makefile_command`
  3249. lib_src_makefile_command='echo "creating lib-src/Makefile";
  3250.   topsrcdir='"${topsrcdir}"';
  3251. ( cd ./lib-src;
  3252.   rm -f junk.c;
  3253.   sed -e '\''s/^# Generated.*//'\'' -e '\''s%/\*\*/#.*%%'\'' < Makefile.in > junk.c;
  3254.   eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
  3255.   < junk.cpp                            '\
  3256. '    sed -e '\''s/^#.*//'\''                    '\
  3257. '    -e '\''s/^[ \f\t][ \f\t]*$//'\''            '\
  3258. '    -e '\''s/^ /    /'\''                     '\
  3259. '    | sed -n -e '\''/^..*$/p'\''                '\
  3260. '    > Makefile.new;
  3261.     chmod 444 Makefile.new;
  3262.     mv -f Makefile.new Makefile;
  3263.     rm -f junk.c junk.cpp;
  3264. )'
  3265. eval `echo $lib_src_makefile_command`
  3266. dynodump_makefile_command='echo "creating dynodump/Makefile";
  3267.   topsrcdir='"${topsrcdir}"';
  3268. ( cd ./dynodump;
  3269.   rm -f junk.c;
  3270.   sed -e '\''s/^# Generated.*//'\'' -e '\''s%/\*\*/#.*%%'\'' < Makefile.in > junk.c;
  3271.   eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
  3272.   < junk.cpp                            '\
  3273. '    sed -e '\''s/^#.*//'\''                    '\
  3274. '    -e '\''s/^[ \f\t][ \f\t]*$//'\''            '\
  3275. '    -e '\''s/^ /    /'\''                     '\
  3276. '    | sed -n -e '\''/^..*$/p'\''                '\
  3277. '    > Makefile.new;
  3278.     chmod 444 Makefile.new;
  3279.     mv -f Makefile.new Makefile;
  3280.     rm -f junk.c junk.cpp;
  3281. )'
  3282. eval `echo $dynodump_makefile_command`
  3283. if [ "${with_energize}" = "yes" ]; then
  3284. energize_makefile_command='echo "creating lwlib/energize/Makefile";
  3285.   topsrcdir='"${topsrcdir}"';
  3286. ( cd ./lwlib/energize;
  3287.   rm -f junk.c;
  3288.   sed -e '\''s/^# Generated.*//'\'' -e '\''s%/\*\*/#.*%%'\'' < Makefile.in > junk.c;
  3289.   eval `echo ${CPP} -I. -I${topsrcdir}/src ${CPPFLAGS} junk.c \>junk.cpp`;
  3290.   < junk.cpp                            '\
  3291. '    sed -e '\''s/^#.*//'\''                    '\
  3292. '    -e '\''s/^[ \f\t][ \f\t]*$//'\''            '\
  3293. '    -e '\''s/^ /    /'\''                     '\
  3294. '    | sed -n -e '\''/^..*$/p'\''                '\
  3295. '    > Makefile.new;
  3296.     chmod 444 Makefile.new;
  3297.     mv -f Makefile.new Makefile;
  3298.     rm -f junk.c junk.cpp;
  3299. )'
  3300. eval `echo $energize_makefile_command`
  3301. fi
  3302. # AC-OUTPUT has created `config.status' already.  We need to add the
  3303. # above commands to re-create `src/Makefile', `lwlib/Makefile',
  3304. # `lib-src/Makefile', `dynodump/Makefile', and possibly
  3305. # `lwlib/energize/Makefile', and we need to insert them before the final
  3306. # "exit 0" which appears at the end of `config.status'.
  3307. <config.status sed -e 's/^exit 0$//' >config.new
  3308. echo $makefile_command >>config.new
  3309. echo $lwlib_makefile_command >>config.new
  3310. echo $lib_src_makefile_command >>config.new
  3311. echo $dynodump_makefile_command >>config.new
  3312. if [ "${with_energize}" = "yes" ]; then
  3313.   echo $energize_makefile_command >>config.new
  3314. fi
  3315. echo exit 0 >>config.new
  3316. mv -f config.new config.status
  3317. chmod +x config.status
  3318. # Don't let the fact that we just rewrote config.status make Makefile think
  3319. # that it is now newer.  We have just rewritten all of the Makefiles as well.
  3320. MFS="Makefile src/Makefile src/Makefile.in lib-src/Makefile dynodump/Makefile lib-src/Makefile.in lwlib/Makefile lwlib/Makefile.in"
  3321. for file in $MFS; do
  3322.    chmod a+w $file; touch $file; chmod 444 $file
  3323. done
  3324. exit 0
  3325.  
  3326. # I've removed "mode: ksh" from the following.  ksh mode sucks for
  3327. # editing this file. (It seems that ksh mode sucks in general.
  3328. # I wonder if the new 19.29 shell-script mode is better.)
  3329.  
  3330. # Local Variables:
  3331. # compile-command: "autoconf"
  3332. # End:
  3333. ]
  3334.